Schema
Val provides a comprehensive set of schema types to define your content structure. Each schema type has its own methods and validation options.
Available Schema Types
s.string()
Text values with validation and rendering options
s.date()
Date values (date-only, not datetime) with ISO 8601 formatting
s.number()
Numeric values with min/max validation
s.boolean()
True/false values
s.literal()
Fixed literal values, used with unions
s.object()
Complex objects with defined properties
s.array()
Lists of items with a defined schema
s.record()
Key-value pairs with dynamic keys
s.router()
Shorthand for creating router configurations
s.union()
One of multiple values
s.keyOf()
References to keys in other Val modules
s.route()
Route references validated against router modules
s.image()
Image files with metadata and remote support
s.file()
Generic files including videos and documents
s.richtext()
Formatted text with configurable options
.nullable()
Make any schema type optional/nullable