Skip to content

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.csscss
/* 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

Root overrides are the easiest to maintain. Provider overrides are useful when feature flags or A/B tests need different looks. Component overrides are escape hatches — if you find yourself using them frequently, consider promoting the override to provider or root scope.

Color tokens

Token

Default

Description

--flexi-color-primary#1E2240

Primary brand color — used for emphasis, focused states, primary buttons

--flexi-color-primary-fg#FAF8F3

Foreground color when rendered on the primary background

--flexi-color-accent#E8A547

Accent color — interactive elements, scoring badges, highlights

--flexi-color-surface#FFFFFF

Default surface background (cards, calendar grid cells)

--flexi-color-surface-muted#FAF8F3

Muted surface — table headers, subdued sections

--flexi-color-text#1E2240

Default body text

--flexi-color-text-muted#5A5A5A

Secondary text — captions, helper text

--flexi-color-borderrgba(30, 34, 64, 0.08)

Default border color

--flexi-color-success#047857

Confirmed, completed, healthy states

--flexi-color-warning#B45309

Soft conflicts, pending states, warnings

--flexi-color-danger#B91C1C

Hard conflicts, failures, destructive actions

Spacing tokens

Token

Default

Description

--flexi-spacing-xs4px

Tight spacing (badge padding, micro gaps)

--flexi-spacing-sm8px

Compact spacing (form field gaps)

--flexi-spacing-md12px

Default spacing (card padding, table rows)

--flexi-spacing-lg16px

Loose spacing (section gaps)

--flexi-spacing-xl24px

Major section spacing

--flexi-spacing-event2px

Gap between adjacent calendar events

Radius tokens

Token

Default

Description

--flexi-radius-sm3px

Small elements (badges, tags)

--flexi-radius-md6px

Default radius (buttons, inputs, event blocks)

--flexi-radius-lg10px

Cards, modals, panels

Type tokens

Token

Default

Description

--flexi-font-displaysystem-ui

Headings and emphasis

--flexi-font-bodysystem-ui

Body text

--flexi-font-monoui-monospace, monospace

Code, IDs, timestamps

--flexi-text-xs11px

Captions, badges

--flexi-text-sm13px

Helper text, table cells

--flexi-text-base14px

Body default

--flexi-text-lg16px

Lead 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

The dark token set is internally consistent — every color in the palette has been tuned against the others for contrast and legibility. If you want a different dark palette, override at the dark-mode level (using a CSS selector like [data-flexi-theme="dark"]) and change the variables coherently. Cherry-picking individual dark values usually breaks contrast somewhere.