Skip to main content

Forms & Validation

PrismUI provides 12 form components and a declarative validation system. All inputs are themed, accessible, and work across platforms.

Form Components

Building a Form

Registration Form

Validation Rules

PrismValidationRule provides a declarative API for field validation. Each rule has a validation closure and an error message.

Built-in Rules

Available Rules

Applying Validation

Pass rules directly to input components:
Field Validation

Custom Rules

Create your own validation rules with a closure:
Custom Validation Rule

PrismPinField

Multi-digit input for PIN codes and OTPs:
PIN Field

PrismRating

Star rating input with half-star support:
Rating

PrismSlider

Range slider with min/max labels and step:
Slider
All form components display validation errors inline when the user interacts with the field and the value doesn’t pass the rules. Error messages use the .error color token automatically.