Components
Theming
Customize the visual appearance of components. All visual tokens are CSS variables, overridable at root, provider, or component scope.
Key points
- Every visual decision is a CSS variable — colors, spacing, radii, type scale
- Override at three levels: root (entire app), provider (subtree), component (single instance)
- Variables are namespaced with --flexi- to avoid collisions with your design system
- Dark mode is opt-in via a data attribute, not automatic from system preference
Override patterns
Root override
For app-wide consistency, override variables on :root:
/* app/globals.css — applies to every component on the page */
:root {
/* Brand */
--flexi-color-primary: #7C3AED; /* purple instead of indigo */
--flexi-color-accent: #EC4899; /* pink instead of copper */
/* Surfaces */
--flexi-color-surface: #FFFFFF;
--flexi-color-surface-muted: #F9FAFB;
/* Type */
--flexi-font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
--flexi-font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
--flexi-font-mono: 'JetBrains Mono', monospace;
}Provider override
To scope overrides to one subtree (e.g. a specific feature flag), set inline styles on the provider:
// Scope overrides to a subtree by setting variables on the provider
<FlexiSchedulerProvider
baseUrl={baseUrl}
token={token}
organizationId={orgId}
style={{
'--flexi-color-primary': '#7C3AED',
'--flexi-color-accent': '#EC4899',
}}
>
<App />
</FlexiSchedulerProvider>Component override
For instance-specific tweaks, override via className:
// Override at the component level via the className prop
<ScheduleCalendar
view="week"
entityId={id}
className="my-calendar"
/>
/* In your CSS */
.my-calendar {
--flexi-color-primary: #059669; /* override just this calendar */
--flexi-spacing-event: 4px;
}Pick the smallest scope that works
Color tokens
Token
Default
Description
--flexi-color-primary#1E2240Primary brand color — used for emphasis, focused states, primary buttons
--flexi-color-primary-fg#FAF8F3Foreground color when rendered on the primary background
--flexi-color-accent#E8A547Accent color — interactive elements, scoring badges, highlights
--flexi-color-surface#FFFFFFDefault surface background (cards, calendar grid cells)
--flexi-color-surface-muted#FAF8F3Muted surface — table headers, subdued sections
--flexi-color-text#1E2240Default body text
--flexi-color-text-muted#5A5A5ASecondary text — captions, helper text
--flexi-color-borderrgba(30, 34, 64, 0.08)Default border color
--flexi-color-success#047857Confirmed, completed, healthy states
--flexi-color-warning#B45309Soft conflicts, pending states, warnings
--flexi-color-danger#B91C1CHard conflicts, failures, destructive actions
Spacing tokens
Token
Default
Description
--flexi-spacing-xs4pxTight spacing (badge padding, micro gaps)
--flexi-spacing-sm8pxCompact spacing (form field gaps)
--flexi-spacing-md12pxDefault spacing (card padding, table rows)
--flexi-spacing-lg16pxLoose spacing (section gaps)
--flexi-spacing-xl24pxMajor section spacing
--flexi-spacing-event2pxGap between adjacent calendar events
Radius tokens
Token
Default
Description
--flexi-radius-sm3pxSmall elements (badges, tags)
--flexi-radius-md6pxDefault radius (buttons, inputs, event blocks)
--flexi-radius-lg10pxCards, modals, panels
Type tokens
Token
Default
Description
--flexi-font-displaysystem-uiHeadings and emphasis
--flexi-font-bodysystem-uiBody text
--flexi-font-monoui-monospace, monospaceCode, IDs, timestamps
--flexi-text-xs11pxCaptions, badges
--flexi-text-sm13pxHelper text, table cells
--flexi-text-base14pxBody default
--flexi-text-lg16pxLead text, subheadings
Dark mode
The library ships with a dark-mode token set. Activate by setting data-flexi-theme="dark" on a parent element:
/* Dark mode is opt-in. Set the data attribute on a parent element. */
<div data-flexi-theme="dark">
<ScheduleCalendar view="week" entityId={id} />
</div>
/* Or globally via the html element */
<html data-flexi-theme="dark">
...
</html>Dark mode is not automatic from prefers-color-scheme — that’s a deliberate choice. Most apps want dark mode driven by their own user-preference store, not the OS-level signal. If you want OS-driven dark mode, wire it to the data attribute yourself.
Don’t override individual dark-mode tokens
[data-flexi-theme="dark"]) and change the variables coherently. Cherry-picking individual dark values usually breaks contrast somewhere.