Nitro Kit 2.0 is agent-native

Nitro Kit 2.0 replaces generated component copies with a gem-owned library of Phlex components. A person and a coding agent now read the same contract, so the component contract table is the whole API surface there is to learn.

What changed

Every component takes explicit keywords, validates its own vocabulary, and raises on anything it does not recognize. Nothing is silently ignored.

  • Options are closed sets. Passing variant: :fancy raises an ArgumentError instead of rendering an unstyled control.
  • Styling hangs off data attributes, so no class strings travel through your templates.
  • Themes are ordinary custom properties under the --nk- prefix.

Rendering a component

Direct Phlex composition is the only public API:

render NitroKit::PageHeader.new(title: "Workspace members") do |header|
  header.actions NitroKit::ButtonGroup.new(label: "Member actions") do |actions|
    actions.button("Invite teammate", variant: :primary)
  end
end

Upgrading

  1. Remove the generated component directory from your application.
  2. Add the gem and run bin/rails nitro_kit:install.
  3. Replace each helper call with the component it wrapped.

The fastest way to make an interface legible to an agent is to make it legible to a person first.


Support window

ReleaseStatusSecurity fixes until
2.0CurrentOngoing
1.2MaintenanceJuly 2027
1.1EndedJanuary 2026

Questions belong in the discussion board; regressions belong in an issue with a reproduction.