invalid is set, all text inside the Field turns red automatically, so the label, description, and error message all respond without wiring each one individually.
Basic Usage
At its simplest, Field is a vertical container that groups a Label with a control.Validation
Setinvalid to highlight a field as having an error. Since invalid accepts reactive expressions, you can tie it to state. Toggle the checkbox below — the label turns red and the error message appears automatically when the field becomes invalid.
The data-invalid attribute on the Field cascades via CSS to all text descendants — the label turns red automatically. FieldError is hidden by default and only appears when its parent Field is invalid, so you don’t need to wrap it in a conditional.
Choice Cards
ChoiceCard is a Field subclass that renders as a bordered, clickable card — useful for settings pages where each row has a toggle. See the ChoiceCard docs for details.API Reference
Field
Whether the field is in an error state. Accepts a reactive expression like
Rx("!email") to tie validation to state.Whether the field is dimmed and non-interactive. Accepts reactive expressions.
Additional Tailwind CSS classes.
FieldError
Error message text, always rendered in destructive (red) styling.
Protocol Reference
Field
FieldError