Winnie CSS
  1. Primitives
  2. field

field

Labelling and validation for form controls.

Import

Import just the field styles.

@import "@winnie-ui/css/spatial/field";
@import "@winnie-ui/css/visual/field";

Anatomy

Attach the appropriate data attributes in the structure below.

<div data-component="field">
<label data-slot="label" />
<span data-slot="description" />
<input data-slot="control" />
<span data-slot="validation" />
</div>

Examples

Description

Add a description with the description slot attribute as a child of the field.

Provide a mouth-watering name for your dish.

Trailing

Place the description slot after the control slot to place it below the control.

Provide a mouth-watering name for your dish.

Validation

Add a validation message with the validation slot attribute as a child of the field.

Oops, don't forget to add a name.

Reference

field

Groups all of the parts of the field together.

Variable
--wui-field-label-color
--wui-field-label-font-weight
--wui-field-description-color
--wui-field-description-font-weight
--wui-field-validation-color
--wui-field-validation-font-weight