Chapter 04 Fields
Fieldset
A titled group of fields inside a longer form. Screen readers read the legend as they enter the group, so a field called Street is heard as part of the delivery address.
import { FieldsetComponent } from '@okaapi-ui/angular';
// An attribute on a native fieldset: <fieldset ui-fieldset legend="…">An address
<fieldset ui-fieldset legend="Delivery address" hint="Where the driver should go.">
<ui-text-field label="Street" autocomplete="address-line1" formControlName="street" />
<ui-text-field label="City" autocomplete="address-level2" formControlName="city" />
</fieldset>In Arabic
<fieldset ui-fieldset legend="عنوان التوصيل">…</fieldset>When to use something else
| If you need | Use |
|---|---|
| A frame around content that is not a form | Card |
| One choice from a few, with a group label | Radio group |
Inputs
| Name | Type | Default | What it does |
|---|---|---|---|
legend | string | — | Required. The group title. |
hint | string | — | A line under the legend, read with the group. |
disabled | boolean | — | The native attribute: disables every field inside. |
Keyboard and screen readers
- The legend is read when focus enters the group, so each field is heard as part of it.