Skip to content
Nitro Kitv2.0.0.beta.3

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 & organizationAccount workspaceCompositions · 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 applicationsStress labCompositions · Quality

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
    • Account workspace
    • 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
  • Quality
    • Stress lab

Grid

Responsive one-to-twelve-column collections with Tailwind-style breakpoint shorthand.

Source
app/components/nitro_kit/grid.rb
API
NitroKit::Grid.new(cols: "1 sm:2 lg:3", gap: "2 md:4")

Mobile-first columns

Column and gap values use the same base, sm, md, lg, xl, and 2xl shorthand as Flex.

One to three cards

API
cols: "1 sm:2 lg:3", gap: "3 md:4 lg:6"

Starter

One workspace, Three members, and Community support

Team

Unlimited workspaces, Twenty members, and Email support

Business

Unlimited members, Audit log, and Priority support

ViewportFull width
Rubytest/dummy/app/components/gallery/components/grid_page.rb
render NitroKit::Container.new(size: :xl) do
  render NitroKit::Grid.new(
    cols: "1 sm:2 lg:3",
    gap: "3 md:4 lg:6",
    id: "gallery-grid-cards"
  ) do
    Gallery::Data.plans.each do |plan|
      render NitroKit::Card.new(id: "gallery-grid-card-#{plan.id}") do |card|
        card.title(plan.name, level: 4)
        card.description(plan.features.to_sentence)
        card.footer do
          card.actions do
            render NitroKit::Button.new(
              plan.current ? "Manage" : "Choose",
              variant: plan.current ? :default : :primary,
              size: :sm
            )
          end
        end
      end
    end
  end
end

Every breakpoint

Track 1Track 2Track 3Track 4Track 5Track 6Track 7Track 8Track 9Track 10Track 11Track 12
ViewportFull width
Rubytest/dummy/app/components/gallery/components/grid_page.rb
render NitroKit::Grid.new(
  cols: "1 sm:2 md:3 lg:4 xl:6 2xl:12",
  gap: "1 sm:2 md:3 lg:4 xl:6 2xl:8",
  id: "gallery-grid-breakpoints"
) do
  12.times do |index|
    render NitroKit::Badge.new(
      "Track #{index + 1}",
      id: "gallery-grid-breakpoint-#{index + 1}",
      variant: :outline
    )
  end
end

Scalar columns

A scalar keeps one column count at every viewport; the closed range is one through twelve.

Representative counts

1 column
1
2 columns
12
3 columns
123
4 columns
1234
6 columns
123456
12 columns
123456789101112
ViewportFull width
Rubytest/dummy/app/components/gallery/components/grid_page.rb
[ 1, 2, 3, 4, 6, 12 ].each do |cols|
  sample("#{cols} #{'column'.pluralize(cols)}", slug: "cols-#{cols}") do
    render NitroKit::Grid.new(cols:, gap: 1, id: "gallery-grid-cols-#{cols}") do
      cols.times do |index|
        render NitroKit::Badge.new(
          "#{index + 1}",
          id: "gallery-grid-cols-#{cols}-#{index + 1}",
          color: :info
        )
      end
    end
  end
end

Independent responsive decisions

Columns and spacing can change at different breakpoints without exposing arbitrary CSS values.

Two useful collection shapes

Catalog

Integration 1

A roomy card collection gains columns gradually.

Integration 2

A roomy card collection gains columns gradually.

Integration 3

A roomy card collection gains columns gradually.

Integration 4

A roomy card collection gains columns gradually.

Integration 5

A roomy card collection gains columns gradually.

Integration 6

A roomy card collection gains columns gradually.

Integration 7

A roomy card collection gains columns gradually.

Integration 8

A roomy card collection gains columns gradually.

Metrics

Region 1

128430 requests

Region 2

256860 requests

Region 3

385290 requests

Region 4

513720 requests

Region 5

642150 requests

Region 6

770580 requests

Region 7

899010 requests

Region 8

1027440 requests

Region 9

1155870 requests

Region 10

1284300 requests

Region 11

1412730 requests

Region 12

1541160 requests

ViewportFull width
Rubytest/dummy/app/components/gallery/components/grid_page.rb
sample("Catalog", slug: "catalog") do
  render NitroKit::Grid.new(
    cols: "1 md:2 xl:4",
    gap: "2 lg:6",
    id: "gallery-grid-catalog"
  ) do
    8.times do |index|
      render NitroKit::Card.new(id: "gallery-grid-catalog-#{index + 1}", size: :sm) do |card|
        card.title("Integration #{index + 1}", level: 4)
        card.description("A roomy card collection gains columns gradually.")
      end
    end
  end
end

sample("Metrics", slug: "metrics") do
  render NitroKit::Grid.new(
    cols: "2 lg:4 2xl:6",
    gap: "2 md:3",
    id: "gallery-grid-metrics"
  ) do
    12.times do |index|
      render NitroKit::Card.new(id: "gallery-grid-metric-#{index + 1}", size: :sm) do |card|
        card.title("Region #{index + 1}", level: 4)
        card.description("#{(index + 1) * 128_430} requests")
      end
    end
  end
end

Content pressure

Empty, partial, dense, and uneven collections retain the declared responsive contract.

Empty, one, and many

Empty
One
One item occupies one track; Grid does not invent a span API.
Many

Record 1

Deterministic collection item

Record 2

Deterministic collection item

Record 3

Deterministic collection item

Record 4

Deterministic collection item

Record 5

Deterministic collection item

Record 6

Deterministic collection item

Record 7

Deterministic collection item

Record 8

Deterministic collection item

Record 9

Deterministic collection item

ViewportFull width
Rubytest/dummy/app/components/gallery/components/grid_page.rb
sample("Empty", slug: "empty") do
  render NitroKit::Grid.new(cols: "1 md:3", gap: 4, id: "gallery-grid-empty")
end
sample("One", slug: "one") do
  render NitroKit::Grid.new(cols: "1 md:3", gap: 4, id: "gallery-grid-one") do
    render NitroKit::Card.new do |card|
      card.body("One item occupies one track; Grid does not invent a span API.")
    end
  end
end
sample("Many", slug: "many") do
  render NitroKit::Grid.new(cols: "1 sm:2 lg:3", gap: 2, id: "gallery-grid-many") do
    9.times do |index|
      render NitroKit::Card.new(size: :sm) do |card|
        card.title("Record #{index + 1}", level: 4)
        card.description("Deterministic collection item")
      end
    end
  end
end

Uneven team records

Ada Lovelace

[email protected]
International Research, Production, and Reliability Engineering

Active

Grace Hopper

[email protected]

Active

Katherine Johnson

[email protected]

Invited

ViewportFull width
Rubytest/dummy/app/components/gallery/components/grid_page.rb
render NitroKit::Grid.new(
  cols: "1 sm:2 lg:3",
  gap: "3 lg:6",
  id: "gallery-grid-team"
) do
  Gallery::Data.members.each do |member|
    render NitroKit::Card.new(id: "gallery-grid-team-#{member.id}") do |card|
      card.header do
        card.title(member.name, level: 4)
        card.description do
          plain member.email
          if member == Gallery::Data.members.first
            br
            plain "International Research, Production, and Reliability Engineering"
          end
        end
        card.actions do
          render NitroKit::Badge.new(
            member.status.to_s.humanize,
            color: member.status == :active ? :success : :info,
            size: :sm
          )
        end
      end
      card.divider
      card.footer do
        card.actions do
          render NitroKit::Button.new("View", size: :sm)
          render NitroKit::Button.new("Change role", size: :sm)
        end
      end
    end
  end
end

Under pressure

Forty Gallery::Hostile member cards in a responsive grid, then thirty hostile badge labels forced into twelve fixed tracks.

Forty hostile members

Dr. Maximiliana Wolfeschlegelsteinhausenbergerdorff-Featherstonehaugh von Hohenzollern-Sigmaringen III

Owner

maximiliana.wolfeschlegelsteinhausenbergerdorff+billing.notifications.eu-west-2026@finance.department.enterprise-holdings-international.example

Wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege

Admin

ünïcödé.tëst+ß@exämple-bücher.test

محمد عبد الرحمن الهاشمي القحطاني

Member

用户@例子.广告

山田太郎(プラットフォームエンジニアリング)

Owner

[email protected]

สวัสดีครับยินดีต้อนรับสู่ระบบจัดการทีมงานของเรา

Admin

wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege@wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege.example

🦄 Unicorn Ops 🚀🔥💯 On-call

Member

maximiliana.wolfeschlegelsteinhausenbergerdorff+billing.notifications.eu-west-2026@finance.department.enterprise-holdings-international.example

Zero​width‍joined⁠namehere

Owner

ünïcödé.tëst+ß@exämple-bücher.test

Ạ̈ḅ̈c̣̈ D̷̢i̶a̸c̵r̷i̶t̸i̵c̷s̶

Admin

用户@例子.广告

X

Member

[email protected]

Dr. Maximiliana Wolfeschlegelsteinhausenbergerdorff-Featherstonehaugh von Hohenzollern-Sigmaringen III

Owner

wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege@wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege.example

Wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege

Admin

maximiliana.wolfeschlegelsteinhausenbergerdorff+billing.notifications.eu-west-2026@finance.department.enterprise-holdings-international.example

محمد عبد الرحمن الهاشمي القحطاني

Member

ünïcödé.tëst+ß@exämple-bücher.test

山田太郎(プラットフォームエンジニアリング)

Owner

用户@例子.广告

สวัสดีครับยินดีต้อนรับสู่ระบบจัดการทีมงานของเรา

Admin

[email protected]

🦄 Unicorn Ops 🚀🔥💯 On-call

Member

wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege@wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege.example

Zero​width‍joined⁠namehere

Owner

maximiliana.wolfeschlegelsteinhausenbergerdorff+billing.notifications.eu-west-2026@finance.department.enterprise-holdings-international.example

Ạ̈ḅ̈c̣̈ D̷̢i̶a̸c̵r̷i̶t̸i̵c̷s̶

Admin

ünïcödé.tëst+ß@exämple-bücher.test

X

Member

用户@例子.广告

Dr. Maximiliana Wolfeschlegelsteinhausenbergerdorff-Featherstonehaugh von Hohenzollern-Sigmaringen III

Owner

[email protected]

Wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege

Admin

wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege@wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege.example

محمد عبد الرحمن الهاشمي القحطاني

Member

maximiliana.wolfeschlegelsteinhausenbergerdorff+billing.notifications.eu-west-2026@finance.department.enterprise-holdings-international.example

山田太郎(プラットフォームエンジニアリング)

Owner

ünïcödé.tëst+ß@exämple-bücher.test

สวัสดีครับยินดีต้อนรับสู่ระบบจัดการทีมงานของเรา

Admin

用户@例子.广告

🦄 Unicorn Ops 🚀🔥💯 On-call

Member

[email protected]

Zero​width‍joined⁠namehere

Owner

wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege@wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege.example

Ạ̈ḅ̈c̣̈ D̷̢i̶a̸c̵r̷i̶t̸i̵c̷s̶

Admin

maximiliana.wolfeschlegelsteinhausenbergerdorff+billing.notifications.eu-west-2026@finance.department.enterprise-holdings-international.example

X

Member

ünïcödé.tëst+ß@exämple-bücher.test

Dr. Maximiliana Wolfeschlegelsteinhausenbergerdorff-Featherstonehaugh von Hohenzollern-Sigmaringen III

Owner

用户@例子.广告

Wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege

Admin

[email protected]

محمد عبد الرحمن الهاشمي القحطاني

Member

wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege@wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege.example

山田太郎(プラットフォームエンジニアリング)

Owner

maximiliana.wolfeschlegelsteinhausenbergerdorff+billing.notifications.eu-west-2026@finance.department.enterprise-holdings-international.example

สวัสดีครับยินดีต้อนรับสู่ระบบจัดการทีมงานของเรา

Admin

ünïcödé.tëst+ß@exämple-bücher.test

🦄 Unicorn Ops 🚀🔥💯 On-call

Member

用户@例子.广告

Zero​width‍joined⁠namehere

Owner

[email protected]

Ạ̈ḅ̈c̣̈ D̷̢i̶a̸c̵r̷i̶t̸i̵c̷s̶

Admin

wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege@wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege.example

X

Member

maximiliana.wolfeschlegelsteinhausenbergerdorff+billing.notifications.eu-west-2026@finance.department.enterprise-holdings-international.example

Dr. Maximiliana Wolfeschlegelsteinhausenbergerdorff-Featherstonehaugh von Hohenzollern-Sigmaringen III

Owner

ünïcödé.tëst+ß@exämple-bücher.test

Wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege

Admin

用户@例子.广告

محمد عبد الرحمن الهاشمي القحطاني

Member

[email protected]

山田太郎(プラットフォームエンジニアリング)

Owner

wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege@wolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflege.example

ViewportFull width
Rubytest/dummy/app/components/gallery/components/grid_page.rb
render NitroKit::Grid.new(
  cols: "1 sm:2 lg:4",
  gap: "2 lg:4",
  id: "gallery-grid-hostile-members"
) do
  Gallery::Hostile.members(40).each do |member|
    render NitroKit::Card.new(id: "gallery-grid-hostile-member-#{member.id}") do |card|
      card.title(member.name, level: 4)
      card.body do
        render NitroKit::Badge.new(
          member.role.to_s.humanize,
          id: "gallery-grid-hostile-member-#{member.id}-role",
          size: :sm
        )
        p { member.email }
      end
    end
  end
end

Twelve fixed tracks

ActiveRegional data residency, retention, and lawful-basis preferences for every workspaceInvitedWolfeschlegelsteinhausenbergerdorffwelchevoralternwarengewissenhaftschaferswessenschafewarenwohlgepflegeSuspendedمحمد عبد الرحمن الهاشمي القحطانيPending review山田太郎(プラットフォームエンジニアリング)Owner🦄 Unicorn Ops 🚀🔥💯 On-callRead-only2,147,483,647,000Betaสวัสดีครับยินดีต้อนรับสู่ระบบจัดการทีมงานของเราDeprecated1999+Awaiting payment confirmation from the issuing bankTrialEnterprisePast dueArchivedLockedVerifiedUnverifiedDisabledDraftScheduledFailedQueued
ViewportFull width
Rubytest/dummy/app/components/gallery/components/grid_page.rb
render NitroKit::Grid.new(cols: 12, gap: 1, id: "gallery-grid-hostile-tracks") do
  Gallery::Hostile::BADGE_LABELS.each_with_index do |label, index|
    render NitroKit::Badge.new(
      label,
      id: "gallery-grid-hostile-track-#{index}",
      color: :info
    )
  end
end

Component contract

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

docs/component_contracts.md · NitroKit::Grid

Constructor
required cols:; gap: 4, id: nil
Root
div[data-nk=grid]
Contract
Columns and gap accept scalar or responsive values. Equal minmax(0, 1fr) tracks; direct content; empty content is valid.

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.