Production API key
nk_live_7P3F · Last used July 13, 2026 at 08:31 UTC
One labelled action group containing typed Button children.
app/components/nitro_kit/button_group.rbNitroKit::ButtonGroup.new(label:) { |group| group.button }Constructor options, rendered root, closed vocabularies, and compound boundary for this component, exactly as shipped.
docs/component_contracts.md · NitroKit::ButtonGroup
buttons: [], label: nil, variant: nil, size: nil, id: nildiv[data-nk=button-group][role=group]buttons:, add, or button. Only NitroKit::Button is accepted and the same instance cannot appear twice. button forwards its arguments verbatim to Button.new, so unknown keywords raise from Button. Group-level variant: and size: are validated against Button vocabularies and fill in only where a button declaration stays silent; instances passed to buttons: or add keep their own treatment. label: and aria: { label: } are the same attribute and collide.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
render NitroKit::Button.new("Save", variant: :primary).ArgumentError; this component's accepted options are in the contract above.html: for HTML, aria: for ARIA, and data: for application data. class and style are forbidden, including inside html:.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.desperately_need_a_class:. It requires a non-blank String and marks the exception with data-nk-escape="class".data-nk; owned parts emit component-qualified data-slot values such as field-control or card-title. Select on those attributes, never on classes.--nk-* custom properties in an application stylesheet. Variables beginning with --_nk-* are private component mechanics.NitroKit::Flex and NitroKit::Grid for layout. Parents own external placement and available width; components own their intrinsic geometry.data-state when styling or behavior also needs it.