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: :fancyraises 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
- Remove the generated component directory from your application.
- Add the gem and run
bin/rails nitro_kit:install. - 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
| Release | Status | Security fixes until |
|---|---|---|
| 2.0 | Current | Ongoing |
| 1.2 | Maintenance | July 2027 |
| 1.1 | Ended | January 2026 |
Questions belong in the discussion board; regressions belong in an issue with a reproduction.