← Back to Components
Field
Form field layout: labels, descriptions, fieldsets, groups, and validation states.
Interactive Playground
R Code
API Reference
block_field()
Layout wrapper for a single form field (label, control, description/error).
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | shiny.tag | tagList | required | Field contents: label, control, and optional description. |
| class | character | NULL | Custom stylesheet class. |
block_field_label()
A text label with an optional for attribute linking to its control's input ID.
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | shiny.tag | tagList | required | Label text or inline content. |
| for | character | NULL | ID of the control this label describes. |
| class | character | NULL | Custom stylesheet class. |
block_field_description()
Helper/description text placed below the control element.
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | shiny.tag | tagList | required | Helper text content. |
| id | character | NULL | Optional id for aria-describedby wiring. |
| class | character | NULL | Custom stylesheet class. |
block_field_group()
Flex grid to position multiple fields side-by-side within a form.
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | shiny.tag | tagList | required | Child block_field() elements. |
| class | character | NULL | Custom stylesheet class. |
block_field_set()
A fieldset surface grouping related controls under a single boundary.
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | shiny.tag | tagList | required | Legend, field groups, and fields. |
| class | character | NULL | Custom stylesheet class. |
block_field_legend()
A legend caption detailing the purpose of the surrounding fieldset.
| Argument | Type | Default | Description |
|---|---|---|---|
| ... | shiny.tag | tagList | required | Legend caption content. |
| class | character | NULL | Custom stylesheet class. |
block_field_invalid()
Server-reactive validator that injects data-invalid attributes, aria descriptors, and formatted red error text.
| Argument | Type | Default | Description |
|---|---|---|---|
| field | shiny.tag | required | The block_field() to mark invalid. |
| message | character | required | Validation error message to display. |