Components
Legend
Provides a title for a group of related form controls.
You should always use the Legend
component in conjunction with the Fieldset component to provide a title for a group of related form controls. See the the Fieldset
component's documentation for more information on when to use a fieldset.
Props
The Legend
component renders a <legend>
element and accepts all props that a standard HTML <legend>
element would accept along with a few additional props:
Slot Props
The Legend
component provides a single slot prop, legendAttrs
, which is only necessary when using the asChild prop.
Attributes
The following attributes are automatically applied to the element rendered by the Legend
component. This is also the shape of the legendAttrs
slot prop when using the asChild prop.