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

Settings layout

A labelled settings navigation beside one neutral content region with a Nitro-owned narrow stack.

Source
app/components/nitro_kit/settings_layout.rb
API
NitroKit::SettingsLayout.new { |layout| layout.navigation(label:) { layout.item(text, href:, icon:, current:) }; layout.content { ... } }

Required regions

One labelled navigation list of typed destinations and one neutral content region form the complete contract.

Workspace settings

  • Profile
  • Security
  • Activity
  • Appearance

Public profile

ViewportFull width
Rubytest/dummy/app/components/gallery/components/settings_layout_page.rb
render NitroKit::SettingsLayout.new(id: "gallery-settings-layout-workspace") do |layout|
  layout.navigation(label: "Workspace settings") do
    DESTINATIONS.each do |destination, icon|
      layout.item(
        destination.to_s.humanize,
        href: "##{destination}",
        icon:,
        current: destination == :profile
      )
    end
  end
  layout.content do
    render NitroKit::Card.new(id: "gallery-settings-layout-profile-card") do |card|
      card.title("Public profile", level: 4)
      card.body do
        render NitroKit::Field.new(
          nil,
          :name,
          id: "gallery-settings-layout-profile-name",
          name: "profile[name]",
          value: "Ada Lovelace",
          label: "Name"
        )
      end
      card.footer do
        render NitroKit::Button.new(
          "Save profile",
          id: "gallery-settings-layout-profile-save",
          variant: :primary
        )
      end
    end
  end
end

Content cardinality

The regions remain explicit with one destination, a single surface, and dense caller-owned content.

One and many

One destination
  • Profile
Nothing needs attention
Your account settings are current.
Dense content
  • Profile
  • Security
  • Activity
  • Appearance
Policy section 1
Policy section 2
Policy section 3
Policy section 4
Policy section 5
Policy section 6
ViewportFull width
Rubytest/dummy/app/components/gallery/components/settings_layout_page.rb
sample("One destination", slug: "one") do
  destinations = [ [ "Profile", "#profile", :user_round ] ]

  render NitroKit::SettingsLayout.new(id: "gallery-settings-layout-one") do |layout|
    layout.navigation(label: "Account settings") do
      destinations.each do |text, href, icon|
        layout.item(text, href:, icon:, current: true)
      end
    end
    layout.content do
      render NitroKit::Alert.new(id: "gallery-settings-layout-one-alert") do |alert|
        alert.title("Nothing needs attention")
        alert.description("Your account settings are current.")
      end
    end
  end
end
sample("Dense content", slug: "many") do
  render NitroKit::SettingsLayout.new(id: "gallery-settings-layout-many") do |layout|
    layout.navigation(label: "Operations settings") do
      DESTINATIONS.each do |destination, icon|
        layout.item(
          destination.to_s.humanize,
          href: "##{destination}",
          icon:,
          current: destination == :security
        )
      end
    end
    layout.content do
      render NitroKit::Flex.new(dir: :col, gap: 2, align: :stretch) do
        6.times do |index|
          render NitroKit::Card.new(id: "gallery-settings-layout-many-#{index + 1}") do |card|
            card.body("Policy section #{index + 1}")
          end
        end
      end
    end
  end
end

Narrow and long pressure

Nitro owns the single 48rem collapse while long labels and product copy remain application data.

Long organization settings

API
The two regions stack automatically at the shared max-width: 48rem condition
  • Public organization identity and verified domains
  • Credential rotation and browser session policy
  • Deployment notification delivery preferences

Public organization identity and verified domains

These settings apply to every administrator, production environment, customer-visible status notification, security event, and invoice issued by this unusually long-named workspace.
ViewportFull width
Rubytest/dummy/app/components/gallery/components/settings_layout_page.rb
render NitroKit::SettingsLayout.new(id: "gallery-settings-layout-long") do |layout|
  layout.navigation(label: "Analytical Engines — International Research and Production settings") do
    layout.item(
      "Public organization identity and verified domains",
      href: "#identity",
      icon: :building_2,
      current: true
    )
    layout.item("Credential rotation and browser session policy", href: "#security", icon: :key_round)
    layout.item("Deployment notification delivery preferences", href: "#notifications", icon: :bell)
  end
  layout.content do
    render NitroKit::Card.new(id: "gallery-settings-layout-long-card") do |card|
      card.title("Public organization identity and verified domains", level: 4)
      card.body(
        "These settings apply to every administrator, production environment, customer-visible status " \
          "notification, security event, and invoice issued by this unusually long-named workspace."
      )
    end
  end
end

Nested compositions

SettingsLayout owns only the two regions; Toolbar and PaginationBar retain their own placement contracts.

Audit settings

  • Profile
  • Security
  • Activity
  • Appearance

Audit retention

Showing audit records 1–25 of 240

  1. Previous
  2. 1
  3. 2
  4. Next
ViewportFull width
Rubytest/dummy/app/components/gallery/components/settings_layout_page.rb
render NitroKit::SettingsLayout.new(id: "gallery-settings-layout-audit") do |layout|
  layout.navigation(label: "Audit settings") do
    DESTINATIONS.each do |destination, icon|
      layout.item(
        destination.to_s.humanize,
        href: "##{destination}",
        icon:,
        current: destination == :activity
      )
    end
  end
  layout.content do
    render NitroKit::Flex.new(dir: :col, gap: 4, align: :stretch) do
      render NitroKit::Toolbar.new(id: "gallery-settings-layout-audit-toolbar") do |toolbar|
        toolbar.leading { h3 { "Audit retention" } }
        toolbar.trailing do
          render NitroKit::Button.new(
            "Export records",
            id: "gallery-settings-layout-audit-export",
            variant: :primary
          )
        end
      end
      render NitroKit::PaginationBar.new(id: "gallery-settings-layout-audit-pagination-bar") do |bar|
        bar.summary("Showing audit records 1–25 of 240")
        bar.pagination(NitroKit::Pagination.new(label: "Audit record pages")) do |pagination|
          pagination.prev
          pagination.page(1, current: true)
          pagination.page(2, href: "?page=2")
          pagination.next(href: "?page=2")
        end
      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::SettingsLayout

Constructor
id: nil
Root
div[data-nk=settings-layout]
Compound contract
Exactly one navigation(label:) and one content region, both block-only and declared inside the render block. The navigation requires at least one item(text, href:, icon: nil, current: false, html:, aria:, data:, desperately_need_a_class:) and renders nav > ul > li > a, where icon: names a Lucide icon and the item attribute bags land on the link; a current item uses aria-current="page" and at most one item is current. Routes remain caller-owned.

Relevant patterns

Application conventions this component belongs to. Each summary is the leading section of its pattern document.

docs/patterns/application_foundation.md

Application foundation

  • Model User, Team, and Membership; roles belong to memberships, and tenant-owned records load through Current.team.
  • Use one AppShell for the authenticated product and one application-owned content gutter inside shell.main.
  • Put route titles and persistent actions in the shell Toolbar; keep destinations in AppNavigation.
  • Use links for settings destinations and one layout-level Toast::FlashMessages region for server feedback.

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.