Skip to content
Nitro Kitv2.0.0.alpha.4

Search gallery…

IntroductionGalleryAgent guideGalleryHuman guideGalleryColorsFoundations · ThemeTypographyFoundations · ThemeSpacing & sizingFoundations · ThemeEffectsFoundations · ThemeButtonComponents · ActionsButton groupComponents · ActionsButton toComponents · ActionsAppearance pickerComponents · FormsCheckboxComponents · FormsCheckbox groupComponents · FormsComboboxComponents · FormsControl groupComponents · FormsDropzoneComponents · FormsFieldComponents · FormsField groupComponents · FormsFieldsetComponents · FormsInputComponents · FormsLabelComponents · FormsRadio buttonComponents · FormsRadio button groupComponents · FormsRich text areaComponents · FormsSelectComponents · FormsSwitchComponents · FormsTextareaComponents · FormsCommand paletteComponents · OverlaysDialogComponents · OverlaysDropdownComponents · OverlaysSheetComponents · OverlaysTooltipComponents · OverlaysAlertComponents · FeedbackEmpty stateComponents · FeedbackToastComponents · FeedbackAccordionComponents · Data displayAvatarComponents · Data displayAvatar stackComponents · Data displayBadgeComponents · Data displayDetails tableComponents · Data displayIconComponents · Data displayProgressive imageComponents · Data displayStat gridComponents · Data displayTableComponents · Data displayTypesetComponents · Data displayPaginationComponents · NavigationPagination barComponents · NavigationTabsComponents · NavigationToolbarComponents · NavigationCardComponents · LayoutContainerComponents · LayoutFlexComponents · LayoutGridComponents · LayoutApplication navigationComponents · ApplicationApplication shellComponents · ApplicationAuthentication shellComponents · ApplicationDanger zoneComponents · ApplicationData sectionComponents · ApplicationForm sectionComponents · ApplicationPage headerComponents · ApplicationSettings layoutComponents · ApplicationSign inCompositions · Access & onboardingPassword resetCompositions · Access & onboardingEmail verificationCompositions · Access & onboardingInvitation acceptanceCompositions · Access & onboardingAccount creationCompositions · Access & onboardingAccount securityCompositions · Access & onboardingWorkspace onboardingCompositions · Access & onboardingBranched onboardingCompositions · Access & onboardingWorkspace dashboardCompositions · Workspace & organizationWorkspace settingsCompositions · Workspace & organizationWorkspace usersCompositions · Workspace & organizationTeam managementCompositions · Workspace & organizationAPI credentialsCompositions · Workspace & organizationOrganization overviewCompositions · Workspace & organizationOrganization settingsCompositions · Workspace & organizationTeam activityCompositions · Workspace & organizationTeam memberCompositions · Workspace & organizationSubscription billingCompositions · Billing & commerceCheckout and paymentCompositions · Billing & commerceCheckout resultsCompositions · Billing & commerceData resource overviewCompositions · Data & operationsData resource activityCompositions · Data & operationsData resource settingsCompositions · Data & operationsProduct resource lifecycleCompositions · Data & operationsAPI webhooksCompositions · Data & operationsIntegration managementCompositions · Data & operationsFile uploadsCompositions · Data & operationsActivity and audit logCompositions · Data & operationsChangelogCompositions · Product & supportHelp centerCompositions · Product & supportSystem status and errorsCompositions · Product & supportProduct landingCompositions · MarketingPublic pricingCompositions · MarketingProduct featuresCompositions · MarketingPublic contactCompositions · MarketingSidebar operations applicationCompositions · Complete applicationsTopbar media applicationCompositions · Complete applicationsHybrid account applicationCompositions · Complete applications

No destinations found.

  • Introduction
  • Agent guide
  • Human guide
  • Foundations
    • Colors
    • Typography
    • Spacing & sizing
    • Effects
  • Actions
    • Button
    • Button group
    • Button to
  • Forms
    • Appearance picker
    • Checkbox
    • Checkbox group
    • Combobox
    • Control group
    • Dropzone
    • Field
    • Field group
    • Fieldset
    • Input
    • Label
    • Radio button
    • Radio button group
    • Rich text area
    • Select
    • Switch
    • Textarea
  • Overlays
    • Command palette
    • Dialog
    • Dropdown
    • Sheet
    • Tooltip
  • Feedback
    • Alert
    • Empty state
    • Toast
  • Data display
    • Accordion
    • Avatar
    • Avatar stack
    • Badge
    • Details table
    • Icon
    • Progressive image
    • Stat grid
    • Table
    • Typeset
  • Navigation
    • Pagination
    • Pagination bar
    • Tabs
    • Toolbar
  • Layout
    • Card
    • Container
    • Flex
    • Grid
  • Application
    • Application navigation
    • Application shell
    • Authentication shell
    • Danger zone
    • Data section
    • Form section
    • Page header
    • Settings layout
  • Access & onboarding
    • Sign in
    • Password reset
    • Email verification
    • Invitation acceptance
    • Account creation
    • Account security
    • Workspace onboarding
    • Branched onboarding
  • Workspace & organization
    • Workspace dashboard
    • Workspace settings
    • Workspace users
    • Team management
    • API credentials
    • Organization overview
    • Organization settings
    • Team activity
    • Team member
  • Billing & commerce
    • Subscription billing
    • Checkout and payment
    • Checkout results
  • Data & operations
    • Data resource overview
    • Data resource activity
    • Data resource settings
    • Product resource lifecycle
    • API webhooks
    • Integration management
    • File uploads
    • Activity and audit log
  • Product & support
    • Changelog
    • Help center
    • System status and errors
  • Marketing
    • Product landing
    • Public pricing
    • Product features
    • Public contact
  • Complete applications
    • Sidebar operations application
    • Topbar media application
    • Hybrid account application

Accordion

Keyed disclosure sections with native buttons and visible state.

Source
app/components/nitro_kit/accordion.rb
API
NitroKit::Accordion.new(id:, mode:) { |accordion| accordion.item }

Anatomy

Native details and summary elements work without JavaScript; single mode uses browser-native named grouping and keeps stable keyed IDs.

Billing questions

Where can I find invoices?
Invoices are available from Billing settings.
Can I change billing currency?
Contact support before the next renewal date.
What happens to a legacy plan?
Legacy plans retain their current limits until an owner chooses a new plan.
Viewport640 px · sm
Rubytest/dummy/app/components/gallery/components/accordion_page.rb
render NitroKit::Accordion.new(id: "gallery-accordion-billing", mode: :single) do |accordion|
  accordion.item(:invoices, title: "Where can I find invoices?", expanded: true) do
    "Invoices are available from Billing settings."
  end
  accordion.item(:currency, title: "Can I change billing currency?") do
    "Contact support before the next renewal date."
  end
  accordion.item(:legacy, title: "What happens to a legacy plan?") do
    "Legacy plans retain their current limits until an owner chooses a new plan."
  end
end

Modes and item counts

Single and multiple expansion modes remain useful from one disclosure through a dense set.

Boundary counts

One closed item
Workspace summary
Mothership is on the Team plan with twelve active members.
One open item
Workspace summary
Mothership is on the Team plan with twelve active members.
Viewport640 px · sm
Rubytest/dummy/app/components/gallery/components/accordion_page.rb
sample("One closed item", slug: "one-closed") do
  render NitroKit::Accordion.new(id: "gallery-accordion-one", mode: :multiple) do |accordion|
    accordion.item(:summary, title: "Workspace summary") do
      "Mothership is on the Team plan with twelve active members."
    end
  end
end

sample("One open item", slug: "one-open") do
  render NitroKit::Accordion.new(id: "gallery-accordion-one-open", mode: :single) do |accordion|
    accordion.item(:summary, title: "Workspace summary", expanded: true) do
      "Mothership is on the Team plan with twelve active members."
    end
  end
end

Multiple open items

General
Workspace name, locale, and time zone.
Members and access
Roles, pending invitations, and session policies.
Billing
Plan, payment method, and invoice history.
Advanced controls
Advanced controls are managed by the organization owner.
Viewport640 px · sm
Rubytest/dummy/app/components/gallery/components/accordion_page.rb
render NitroKit::Accordion.new(id: "gallery-accordion-multiple", mode: :multiple) do |accordion|
  accordion.item(:general, title: "General", expanded: true) do
    "Workspace name, locale, and time zone."
  end
  accordion.item(:members, title: "Members and access", expanded: true) do
    "Roles, pending invitations, and session policies."
  end
  accordion.item(:billing, title: "Billing") do
    "Plan, payment method, and invoice history."
  end
  accordion.item(:advanced, title: "Advanced controls") do
    "Advanced controls are managed by the organization owner."
  end
end

Content pressure

Long labels, long copy, nested markup, and many items use the same keyed declaration API.

Long and nested content

How does workspace data retention change when a long-running organization changes plans?

Workspace records remain available throughout the current billing period. Exported audit events continue to use their original timestamps and actor identifiers.

  • Active members keep their existing access until the renewal date.
  • Pending invitations can be revoked before the plan changes.
  • Invoice and audit exports remain available to workspace owners.
Exports
Exports are prepared as UTF-8 CSV files.
Data regions
The workspace currently uses the EU region.
Active sessions
Owners can revoke individual sessions.
Webhook delivery
Failed deliveries retry with backoff.
Legacy retention controls
Legacy controls remain visible while owners plan their replacement.
Viewport640 px · sm
Rubytest/dummy/app/components/gallery/components/accordion_page.rb
render NitroKit::Accordion.new(id: "gallery-accordion-pressure", mode: :multiple) do |accordion|
  accordion.item(
    :retention,
    title: "How does workspace data retention change when a long-running organization changes plans?",
    expanded: true
  ) do
    p do
      "Workspace records remain available throughout the current billing period. Exported audit events " \
        "continue to use their original timestamps and actor identifiers."
    end
    ul do
      li { "Active members keep their existing access until the renewal date." }
      li { "Pending invitations can be revoked before the plan changes." }
      li { "Invoice and audit exports remain available to workspace owners." }
    end
  end
  accordion.item(:exports, title: "Exports") { "Exports are prepared as UTF-8 CSV files." }
  accordion.item(:regions, title: "Data regions") { "The workspace currently uses the EU region." }
  accordion.item(:sessions, title: "Active sessions") { "Owners can revoke individual sessions." }
  accordion.item(:webhooks, title: "Webhook delivery") { "Failed deliveries retry with backoff." }
  accordion.item(:legacy, title: "Legacy retention controls") do
    "Legacy controls remain visible while owners plan their replacement."
  end
end

Detail composition

An operational detail view composes cards, status, tables, and grouped actions inside panels.

Deployment detail

Deployment overview

Billing portal · release 1842

Operational

Deployed by Grace Hopper on July 13, 2026 at 08:42 UTC.

View logs
Health checks
Deployment health checks
CheckResult
Application bootPassed
Database connectionPassed
Queue latency42 ms
Environment and access

Production environment

EU region · protected branch · owner approval required

Protected
Viewport640 px · sm
Rubytest/dummy/app/components/gallery/components/accordion_page.rb
render NitroKit::Accordion.new(id: "gallery-accordion-deployment", mode: :single) do |accordion|
  accordion.item(:overview, title: "Deployment overview", expanded: true) do
    render NitroKit::Card.new(id: "gallery-accordion-deployment-card") do |card|
      card.title("Billing portal · release 1842", level: 3)
      card.body do
        render NitroKit::Badge.new(
          "Operational",
          id: "gallery-accordion-deployment-status",
          color: :success,
          size: :sm
        )
        p { "Deployed by Grace Hopper on July 13, 2026 at 08:42 UTC." }
      end
      card.footer do
        render NitroKit::ButtonGroup.new(
          id: "gallery-accordion-deployment-actions",
          label: "Deployment actions"
        ) do |group|
          group.button(
            "View logs",
            id: "gallery-accordion-deployment-logs",
            href: "#deployment-logs",
            size: :sm
          )
          group.button(
            "Roll back",
            id: "gallery-accordion-deployment-rollback",
            variant: :destructive,
            size: :sm
          )
        end
      end
    end
  end

  accordion.item(:checks, title: "Health checks") do
    render_health_checks
  end

  accordion.item(:environment, title: "Environment and access") do
    render NitroKit::Card.new(id: "gallery-accordion-environment-card") do |card|
      card.title("Production environment", level: 3)
      card.body do
        p { "EU region · protected branch · owner approval required" }
      end
      card.footer do
        render NitroKit::Badge.new(
          "Protected",
          id: "gallery-accordion-environment-status",
          variant: :outline,
          color: :info
        )
      end
    end
  end
end

Component contract

Constructor options, rendered root, closed vocabularies, and compound boundary for this component, exactly as shipped.

docs/component_contracts.md · NitroKit::Accordion

Constructor-specific options
  • required id:
  • mode: :multiple
Root and closed vocabulary
div[data-nk=accordion]; modes multiple single
Compound contract
Requires one or more uniquely keyed item(key, title:, expanded: false) declarations. Each item renders native details and summary, so find-in-page and fragment navigation reveal matching closed content without a controller. Single mode gives every disclosure the same name and accepts at most one initially expanded item; multiple mode omits name. There is no disabled item or controller.

System rules for coding agents

Instructions for coding agents, repeated on every component page so one fetched page has enough context. Humans can usually skip this section.

test/dummy/app/components/gallery/agent_rules.rb

View agent instructions
  • Nitro Kit 2.0 is a gem-owned, Phlex-only UI system for Rails. Render components directly: render NitroKit::Button.new("Save", variant: :primary).
  • Compose Nitro components inside application-owned Phlex classes. Public initializers and declared slots are the component API; private methods are not.
  • Public options are explicit keywords, and enumerated options are closed vocabularies. Invalid names or values raise ArgumentError; this component's accepted options are in the contract above.
  • Pass native attributes through their typed boundary: html: for HTML, aria: for ARIA, and data: for application data. class and style are forbidden, including inside html:.
  • Nitro owns NitroKit::Component::RESERVED_DATA_ATTRIBUTES: data-nk, data-slot, data-variant, data-size, data-nk-escape, data-enhanced, data-state, data-disabled, data-required, data-orientation, data-presentation, data-placement, data-layout, data-side, data-field-type, data-dir, data-gap, data-align, data-justify, data-wrap, data-cols, data-mode, data-key. Do not pass them through data:. data-action, data-controller are additive and compose with Nitro behavior.
  • If an integration truly requires a class, use desperately_need_a_class:. It requires a non-blank String and marks the exception with data-nk-escape="class".
  • Every root emits data-nk; owned parts emit component-qualified data-slot values such as field-control or card-title. Select on those attributes, never on classes.
  • Customize components with documented --nk-* custom properties in an application stylesheet. Variables beginning with --_nk-* are private component mechanics.
  • Use NitroKit::Flex and NitroKit::Grid for layout. Parents own external placement and available width; components own their intrinsic geometry.
  • Preserve native elements and accessibility semantics. State is exposed through native semantics and ARIA first, and through data-state when styling or behavior also needs it.