# Field Composes a label, a control, and helper text into an accessible form field. ## Use cases - **Use**: as a unified shell for form fields (label + control + description + error) - **Use**: when you need to place a label and a control side-by-side in a horizontal layout - **Use**: to group multiple fields into a semantic group (FieldSet + FieldLegend) - **Don't**: use for single-line inline text (use the `text` widget instead) - **Don't**: use in places where native HTML `
` submission semantics are required (LCUI does not replicate them) ## Usage ```tsx import { Field, FieldLabel, FieldDescription, FieldSet } from "@lcui/react" ``` ```tsx Username Choose a unique username. ``` ## Composition Use the following composition to build a Field: ``` Field ├── FieldLabel ├── TextInput / Checkbox / RadioGroup └── FieldDescription FieldSet ├── FieldLegend ├── FieldDescription └── FieldGroup ├── Field ├── FieldSeparator └── Field ``` ## Examples ### Checkbox ### Choice Card ### Fieldset ### Field Group ### Input ### Radio ## API Reference ### Field A field container providing orientation control. ### FieldSet A semantic grouping container. ### FieldLegend The title of a group. ### FieldGroup A visual stacking container. ### FieldLabel A field label whose clicks are forwarded to the target input. ### FieldContent The text content block within a horizontal field. ### FieldTitle The title text within a FieldContent. ### FieldDescription Helper text for a field. ### FieldSeparator A horizontal divider between field groups. ## Caveats :::note **FieldLabel's click forwarding depends on the `for` attribute**. You must set `for="input-id"` on the FieldLabel and assign the same `id` to the target control, otherwise the click will not be forwarded. :::