Font

ReferenceSchema API

s.font()

A typeface, picked from a font library.

Use it for

  • Letting editors choose the font of a heading or a theme

Reference

s.font(fontsVal)

schema

A font picked from a s.fontdir() module. The Studio shows it as its letterform and file name, and opens the library to pick from.

Example

A heading font

TypeScript
import fontsVal from "./fonts.val"; // an s.fontdir() module

const schema = s.object({ headingFont: s.font(fontsVal) });
// { headingFont: { path: "/public/val/fonts/inter_a1b2c.woff2" } }
See alsofontdir