Composes accessible labels, controls, descriptions, and validation messages for form fields.
Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
fieldset[appFieldSet] (optional) ├── legend[appFieldLegend] ├── [appFieldSetDescription] (optional) ├── [appFieldSetError] (optional) └── [appFieldGroup] or grouped control ├── [appField] or [appFieldItem] │ ├── label[appFieldLabel] │ │ └── [appFieldRequiredIndicator] (optional) │ ├── form control │ │ ├── [appFieldInput] │ │ ├── [appFieldSelect] │ │ └── textarea[appFieldTextarea] │ ├── [appFieldContent] (optional) │ │ ├── [appFieldTitle] or label[appFieldLabel] │ │ └── [appFieldDescription] (optional) │ ├── [appFieldDescription] (optional) │ └── [appFieldError] (optional) └── [appFieldSeparator] (optional)
Examples
Choice Cards
Loading...
Default
Loading...
Disabled
Loading...
Fieldset
Loading...
Orientation
Loading...
Validation
Loading...
API Reference
Apply the directives to native elements and use class plus the native attributes supported by
the host element. FieldImports contains every styled directive and both context providers listed
below.
[appField]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to create the field part IDs. |
ids | FieldElementIds | undefined | — | Overrides generated identifiers for the field parts. |
required | boolean | false | Marks the associated control as required. |
disabled | boolean | false | Marks the field and its associated control as disabled. |
invalid | boolean | false | Marks the field and its associated control as invalid. |
readOnly | boolean | false | Marks the associated control as read-only. |
target | string | undefined | — | Identifies the form control associated with the field. |
orientation | "vertical" | "horizontal" | "responsive" | "vertical" | Controls the visual arrangement of the field parts. |
fieldset[appFieldSet]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to connect the fieldset parts. |
disabled | boolean | false | Disables the controls contained by the fieldset. |
invalid | boolean | false | Marks the controls contained by the fieldset as invalid. |
legend[appFieldLegend]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
variant | "legend" | "label" | "legend" | Controls the legend's visual typography variant. |
textarea[appFieldTextarea]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
autoresize | boolean | false | Grows the textarea vertically to fit its current value. |
[appFieldItem]
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
value | string | required | Identifies the item when deriving control and label IDs in a group. |
Context, Providers, and Utilities
| Export | Angular API |
|---|---|
FieldRootProvider | Provides an externally created field API through its required value input. |
FieldsetRootProvider | Provides an externally created fieldset API through value. |
useField(options) | Creates the signal-backed field API inside an Angular injection context. |
useFieldset(options) | Creates the signal-backed fieldset API inside an Angular injection context. |
injectFieldContext() | Injects the nearest field context. |
injectFieldContextOptional() | Injects the nearest field context when one exists. |
injectFieldsetContext() | Injects the nearest fieldset context. |
injectFieldsetContextOptional() | Injects the nearest fieldset context when one exists. |
FieldImports | Readonly collection containing the field UI and context providers. |
Types
| Export | Description |
|---|---|
FieldElementIds | Optional overrides for generated field part IDs. |
FieldResolvedIds | Fully resolved identifiers used by a field instance. |
UseFieldProps | Configuration accepted by useField. |
UseFieldOptions | Angular context options passed to useField. |
UseFieldReturn | Signal-backed field state, prop getters, and registration APIs. |
FieldsetResolvedIds | Fully resolved identifiers used by a fieldset instance. |
UseFieldsetProps | Configuration accepted by useFieldset. |
UseFieldsetOptions | Angular context options passed to useFieldset. |
UseFieldsetReturn | Signal-backed fieldset state and prop getters. |
Angular
React
Solid
Svelte
Vue