Skip to content
Components

Input

Native single-line input.

After the one-time setup, call the helper directly from ERB. No component import is needed.

<%= lc_input name: "title", placeholder: "Small", size: :sm, class: "max-w-sm", aria: { label: "Small input" } %>
<%= lc_input name: "title", placeholder: "Default", class: "max-w-sm", aria: { label: "Default input" } %>
<%= lc_input name: "title", placeholder: "Large", size: :lg, class: "max-w-sm", aria: { label: "Large input" } %>
<%= lc_input name: "title", placeholder: "Small", size: :sm, class: "max-w-sm", aria: { label: "Small input" } %>
<%= lc_input name: "title", placeholder: "Default", class: "max-w-sm", aria: { label: "Default input" } %>
<%= lc_input name: "title", placeholder: "Large", size: :lg, class: "max-w-sm", aria: { label: "Large input" } %>
<%= lc_input value: "Read-only value", readonly: true, class: "max-w-sm", aria: { label: "Read-only input" } %>
<%= lc_input placeholder: "Disabled", disabled: true, class: "max-w-sm", aria: { label: "Disabled input" } %>
<%= lc_input type: :search, icon: "magnifying-glass", name: "q", placeholder: "Search currencies", class: "max-w-sm rounded-full", aria: { label: "Search currencies" } %>

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_input

lc_input(name: nil, value: nil, type: :text, size: :md, plain: false, icon: nil, **attributes)
InputDefaultValues
namenil—
valuenil—
type:text:text · :search · :email · :password · :tel · :url · :number · :date · :time · :datetime-local · :month · :week
size:md:sm · :md · :lg
plainfalsetrue · false
iconnilHeroicon name; spacing is handled automatically
attributes{}Native HTML attributes; class:, data: and aria: merge with defaults

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.

API JSON · LLM reference