Native select
Native options with consistent sizing.
Usage
After the one-time setup, call the helper directly from ERB. No component import is needed.
<%= lc_select [["Design", "design"], ["Engineering", "engineering"]], name: "team", selected: "design", class: "max-w-sm", aria: { label: "Team" } %>
Examples
Native select
<%= lc_select [["Design", "design"], ["Engineering", "engineering"]], name: "team", selected: "design", class: "max-w-sm", aria: { label: "Team" } %>
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_select
lc_select(options = nil, name: nil, selected: nil, size: :md, **attributes, &block)
| Input | Default | Values |
|---|---|---|
| options | nil | — |
| name | nil | — |
| selected | nil | — |
| size | :md | :sm · :md · :lg |
| attributes | {} | Native HTML attributes; class:, data: and aria: merge with defaults |
| block | Captured block | Captured Rails ERB content |
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.