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.number()
Numeric values with min/max validation
s.boolean()
True/false values
s.literal()
Fixed literal values, used with unions
s.date()
Date values (date-only, not datetime) with ISO 8601 formatting
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.route()
Route references validated against router modules
s.router()
Shorthand for creating router configurations
s.union()
One of multiple values
s.keyOf()
References to keys in other Val modules
s.image()
Image files with metadata and remote support
s.images()
An image gallery: a whole module of images that fields can pick from
s.file()
Generic files including videos and documents
s.files()
A collection of files of any type, as a whole module
s.richtext()
Formatted text with configurable options