Forms

Label

A styled label/legend with an optional description and required asterisk, rendered as whichever tag fits the context — used internally by `FormField`, `Checkbox`, `Radio`, `Switch`, `CheckboxGroup`, and `RadioGroup`, but usable on its own for a custom field layout.

html
<UiLabel />

Tag

tag is label by default. Switch it when the surrounding markup needs something else — a legend inside a fieldset, or a div where a real label would steal a click from the control beneath it.

Rendered as a legend
Rendered as a div
Rendered as a span

Description

description is secondary text below the label, for the sentence that would clutter the label itself.

Required

required adds a trailing asterisk. Marking the field is all it does — the validation lives on the control.

Default slot

The label text itself.

This is what every other form component renders internally

FormField, Checkbox, Radio, Switch, CheckboxGroup, and RadioGroup all forward their own label/legend, description, and required props straight to this component (with the tag that fits their own markup) — reach for Label directly only when you need a custom layout none of them support.


API Reference

Generated from the component's source — props, slots and emits as the component actually declares them.

Props

Prop
Type
Default
Description
"label" | "legend" | "div" | "span"
'label'
The tag to render the Label as — `label` for a standalone form field, `legend` inside a `fieldset`, or `div`/`span` when nested inside another element that's already a `<label>` (e.g. `Checkbox`, `Switch`).
string
Additional descriptive text displayed below the label.
boolean
false
Shows a required-field asterisk after the label text.

Slots

Slot
default