@osforms/react use a theme system built on top of FormTheme. You can customize colors, typography, border radius, and button style.
Default Theme
The default theme is dark, matching the osforms dashboard:FormTheme Reference
colors
| Property | Default | Description |
|---|---|---|
background | #0a0a0a | Main background color |
surface | #212121 | Card / input surface color |
primary | #fafafa | Primary button fill and active accents |
text | #fafafa | Primary text color |
textSecondary | #a8a8a8 | Helper text, labels, placeholders |
border | #333333 | Input and card borders |
error | #ef4444 | Validation error messages |
fontFamily
Default:Inter, -apple-system, ...system-ui, sans-serif
Pass any valid CSS font-family string. The font itself is not loaded automatically — ensure it’s available in your app.
fontSize
| Value | Resolved | Description |
|---|---|---|
sm | 14px | Compact |
md | 16px | Default |
lg | 18px | Large / accessible |
borderRadius
| Value | Resolved | Description |
|---|---|---|
none | 0px | Sharp corners |
sm | 4px | Slightly rounded |
md | 8px | Default |
lg | 12px | Rounded |
full | 9999px | Pill-shaped |
buttonVariant
| Value | Description |
|---|---|
solid | Filled button (default) |
outline | Transparent with border |
ghost | No border or fill |
Applying Themes
Via OSForm prop
Pass a partial theme — only the properties you specify are overridden:
Via FormSchema
Themes can also be embedded in the form schema itself. TheOSForm theme prop overrides the schema theme: