vael-ui v0.3.10

Forms & Inputs

Field

Wraps a form control with a label, help text, and error message, wired together for you.

Install

import { Field } from 'vael-ui'

Playground

import { Field } from 'vael-ui'

<Field label="" description="" error="" :required="false" :disabled="false" labelPlacement="top">Field</Field>

Props

NameTypeDefaultDescription
labelstring | undefined
descriptionstring | undefined
errorstring | undefinedError message; renders with `role="alert"`.
requiredboolean | undefined
disabledboolean | undefined
labelPlacement"top" | "float" | "inset""top"`'top'` stacks above the control; `'float'` overlays on the edge (animates up on focus/fill); `'inset'` overlays inside the control.
uiPartial<{ root: UiPartValue; label: UiPartValue; control: UiPartValue; description: UiPartValue; error: UiPartValue; }> | undefined

Slots

NameTypeDescription
defaultany
labelanyReplaces label text without affecting label element or for wiring.
descriptionany
error{ error: string; }

Events

No events.

Exposed

NameTypeDescription
elHTMLElement | null