Skip to main content
@osforms/react exposes the full FormTheme type for TypeScript consumers. The theme prop is layered over the schema theme and the default dark theme.

FormTheme

fontSize and borderRadius mostly affect classic mode. Conversational mode uses its own fixed sizes.

Priority

Theme values are resolved in this order (highest to lowest):
  1. OSForm theme prop
  2. FormSchema.theme
  3. Default dark theme
The first two are merged one level deep: each top-level key you pass (colors, fontFamily, borderRadius, …) replaces the schema’s value for that key. So colors replaces the schema’s entire colors object, and colors you leave out fall back to the SDK defaults, not to the schema. Pass every color you care about.

Passing themes

Light theme example

Custom fonts

Set fontFamily to any CSS font-family string. The SDK does not load fonts — ensure the font is loaded in your app (e.g., via Google Fonts or next/font):

ConversationalRenderer and ClassicRenderer

The low-level renderers don’t apply defaults. Their theme prop needs a complete theme: all 7 colors, plus fontFamily, fontSize and borderRadius as CSS values, and buttonVariant. Most apps should use OSForm instead.
For custom renderer patterns, see Hooks. For a full reference of theme options, see Core / Theming.