Examples
Complete tng-form-field patterns that pair labels, controls, hints, and errors with copy-paste ready Plain-CSS and Tailwind CSS variants.
Form usage
Use the wrapper around TailNG control composition and field messages inside real form flows.
Form usage (Plain-CSS)
Form usage (Tailwind CSS)
Basic field
A vertical form field with one label, one control, and one hint.
Basic field (Plain-CSS)
Basic field (Tailwind CSS)
Supported controls
Each supported TailNG control can sit in the same label, control, hint, and error contract. Fields use the default above label in a two-column layout from 720px.
Supported controls (Plain-CSS)
Supported controls (Tailwind CSS)
Supported control label positions
The same supported controls—including input groups with prefix and suffix adornments—can place the label on the outline, above the border, or left of the border. Outline and above use a two-column layout from 720px; left uses a single column.
Supported controls (Outline)
Supported controls (Above)
Supported controls (Left)
Left label
Use labelPosition left when dense forms need labels to sit beside the bordered control frame.
Left label field (Plain-CSS)
Left label field (Tailwind CSS)
Error state with input group
Nest an input group when the control needs prefix or suffix content, and let the field own message visibility.
Invalid input group field (Plain-CSS)
Invalid input group field (Tailwind CSS)
Inline controls
Switch, toggle, and single checkbox auto-adopt the inline-trailing layout: the label sits to the right of the control on the same row, no outlined frame.
Composite controls
Slider, listbox, input-otp, toggle-group, month-day picker, year picker, and single radio all sit inside a plain frame — the control draws its own chrome while the form-field owns label and messages.