← 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).

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredField contents: label, control, and optional description.
classcharacterNULLCustom stylesheet class.

block_field_label()

A text label with an optional for attribute linking to its control's input ID.

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredLabel text or inline content.
forcharacterNULLID of the control this label describes.
classcharacterNULLCustom stylesheet class.

block_field_description()

Helper/description text placed below the control element.

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredHelper text content.
idcharacterNULLOptional id for aria-describedby wiring.
classcharacterNULLCustom stylesheet class.

block_field_group()

Flex grid to position multiple fields side-by-side within a form.

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredChild block_field() elements.
classcharacterNULLCustom stylesheet class.

block_field_set()

A fieldset surface grouping related controls under a single boundary.

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredLegend, field groups, and fields.
classcharacterNULLCustom stylesheet class.

block_field_legend()

A legend caption detailing the purpose of the surrounding fieldset.

ArgumentTypeDefaultDescription
...shiny.tag | tagListrequiredLegend caption content.
classcharacterNULLCustom stylesheet class.

block_field_invalid()

Server-reactive validator that injects data-invalid attributes, aria descriptors, and formatted red error text.

ArgumentTypeDefaultDescription
fieldshiny.tagrequiredThe block_field() to mark invalid.
messagecharacterrequiredValidation error message to display.