Fields

Inputs, selects, checkboxes and the search field, all 34px to line up with buttons.

Helper
field(label, hint: nil, error: nil) do
  # the control: text_field_tag, f.select… with class "tr-input" / "tr-select"
end

search_input(name: :q, value: nil, placeholder: "Buscar", label: nil, **html)

field wraps any control with its label and a hint or error. Style the control with tr-input, tr-select or tr-check (also through form builders: f.text_field :name, class: "tr-input"). search_input is the search box with its icon; in a page header's filters row it grows to fill the row.

Read-only and disabled

Read-only (readonly: true) keeps a white field with a lighter border: the value reads and copies normally but cannot change. Disabled (disabled: true) is greyed out with muted text and a not-allowed cursor, and its label turns muted too. Say in the hint why a field is disabled and what unlocks it.

Options

OptionWhat it does
labelText before the control
hintMuted help line under the control
errorError line under the control; also set aria-invalid on the control