Field

The Field component provides a reusable pattern for field in the interface.

Text

Note: Attributes can both be set as component parameters and in attribute list. Using attributes implemented in component parameters, will result in a warning. Attributes set will automatically appear wherever suitable (on html-input or component level).

Hey! Want some help with this?

Range

Color

API

Parameter Default Description
Label for the field.
The name of the field (html name='')
text text, checkbox and radio
false Regular expression for validation. Will apply on non empty strings or all strings when required.
false Message to display when the field is invalid.
false Require this field to be filled in.
on Browser automatically completes the input values based on values that the user has entered before. Reference: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete
Field value
Adds a icon before the input field (string)
md -
md If any special type of rounded corners should be used (none, xs, sm, md, lg)
Example value for field
false This will remove the visible label. Label will be auditible for screen readers.
Text displayed below the field.
false Render textarea instead of input. Boolean or number of rows to render.
false Removes the border around the input field
false If the current theme applies shadows to element, append shadow here too.
[] Attributes for field element. Valid input attributes are casted to here from attributesList.
true If we should move attributesList to fieldAttributeList automatically
Description for the field.

CSS API

Variable Default Type Values Description
var(--border-radius) range - Border Radius
var(--border-width) range - Size
var(--space) range - Base spacing unit. Used for padding and margin inside components.
var(--color--danger) color - Danger
var(--color--success) color - Success
var(--color--surface-alt) color - Manual companion token for subtle surface backgrounds.
var(--color--surface-border) color - Manual companion token for borders on surface elements.
var(--shadow-color) rgba - Shadow Color
var(--shadow-amount) range - Multiplier for elevation shadows. 0 = none, 1 = default.
var(--color--surface-contrast) color - Used for text and icons on surface backgrounds with less contrast.
var(--base) range - Main unit that drives radius and spacing scales.
var(--corner-shape) select square, round, squircle, circular, bevel, scoop Corner Shape
var(--color--primary) color - Primary
var(--color--danger-contrast) color - Danger Contrast