Components
Checkbox
Native checkboxes with labels and hints.
Usage
After the one-time setup, call the helper directly from ERB. No component import is needed.
<%= lc_stack gap: :related do %>
<%= lc_checkbox "Email me about comments", name: "notify[comments]", checked: true %>
<%= lc_checkbox "Weekly digest", name: "notify[digest]", hint: "A summary every Monday." %>
<%= lc_checkbox "Product news", name: "notify[news]", disabled: true %>
<% end %>
Examples
Checkboxes
<%= lc_stack gap: :related do %>
<%= lc_checkbox "Email me about comments", name: "notify[comments]", checked: true %>
<%= lc_checkbox "Weekly digest", name: "notify[digest]", hint: "A summary every Monday." %>
<%= lc_checkbox "Product news", name: "notify[news]", disabled: true %>
<% end %>
API reference
Helpers render semantic HTML and include their interaction wiring. Pass native attributes through class:, data:, aria: and the usual Rails options. Blocks use captured ERB content.
lc_checkbox
lc_checkbox(label, name: nil, value: "1", checked: false, unchecked_value: "0", hint: nil, card: false, **attributes, &block)
| Input | Default | Values |
|---|---|---|
| label | Required | Accessible name, visible where applicable |
| name | nil | — |
| value | "1" | — |
| checked | false | true · false |
| unchecked_value | "0" | — |
| hint | nil | — |
| card | false | true · false |
| attributes | {} | Native HTML attributes; class:, data: and aria: merge with defaults |
| block | Captured block | Captured Rails ERB content |
The examples also use lc_stack. Each is documented on its own page.
Styling and extension
Use class: to merge utilities, native attributes for application behavior, and the theming guide for the shared palette. For custom markup, the advanced class helpers expose the same styles, including glass surfaces and class merging.