Overview

Record Schema

s.record(schema)

Record type with element schema

A record is a collection of key-value pairs. It can be used as a list of objects that have a unique key.

Methods:
.validate: method

Custom validation function

.render: method

Render the record as a list

s.record(s.object({
  name: s.string(),
  age: s.number(),
})).render({ as: "list", select: ({ key, val }) => ({ title: val.name, subtitle: val.age }) })
.router: method

Use the router method to automatically generate pages for each entry in the record

Example:
s.record(s.object({
  name: s.string(),
  age: s.number(),
}))