Skip to content
Reeflow
Start Building

Theming and Styling

The Reeflow SDK provides a flexible theming system that allows you to customize the appearance of all components. You can use built-in themes, create custom themes, or apply CSS customizations.

The SDK includes two professionally designed themes:

A warm, modern theme with earthy tones and subtle contrast.

<reeflow-provider auth-token="your-token" theme="default">
<!-- components -->
</reeflow-provider>

The default theme features:

  • Warm terracotta primary color (#c96442)
  • Soft beige secondary and accent tones
  • Professional and approachable aesthetic
  • Suitable for most business applications

A calming theme inspired by aquatic blues and teals.

<reeflow-provider auth-token="your-token" theme="ocean">
<!-- components -->
</reeflow-provider>

The ocean theme features:

  • Cool blues and cyan tones
  • Serene, calming aesthetic
  • Marine-inspired color palette
  • Ideal for data-focused dashboards

All themes support three color scheme modes:

Automatically adapts to the user’s system preference:

<reeflow-provider auth-token="your-token" theme-mode="auto">
<!-- components -->
</reeflow-provider>

The SDK detects the user’s operating system preference (light or dark mode) and applies the appropriate color scheme automatically.

Forces light mode regardless of system preference:

<reeflow-provider auth-token="your-token" theme-mode="light">
<!-- components -->
</reeflow-provider>

Forces dark mode regardless of system preference:

<reeflow-provider auth-token="your-token" theme-mode="dark">
<!-- components -->
</reeflow-provider>

While the Provider component sets the default theme for all children, individual components can override the theme:

<reeflow-provider auth-token="your-token" theme="default">
<!-- Uses default theme -->
<reeflow-bar-chart>...</reeflow-bar-chart>
<!-- Overrides with ocean theme -->
<reeflow-table theme="ocean">...</reeflow-table>
<!-- Overrides with ocean theme in dark mode -->
<reeflow-line-chart theme="ocean" theme-mode="dark">
...
</reeflow-line-chart>
</reeflow-provider>

This allows for maximum flexibility when mixing components with different visual styles.

You can change themes at runtime programmatically:

Using React state to control the theme:

import { useState } from 'react';
import { ReeflowProvider } from '@reeflow/react';
function Dashboard() {
const [theme, setTheme] = useState('default');
const [themeMode, setThemeMode] = useState<'auto' | 'light' | 'dark'>('auto');
return (
<>
<select value={theme} onChange={(e) => setTheme(e.target.value)}>
<option value="default">Default</option>
<option value="ocean">Ocean</option>
</select>
<select value={themeMode} onChange={(e) => setThemeMode(e.target.value as any)}>
<option value="auto">Auto</option>
<option value="light">Light</option>
<option value="dark">Dark</option>
</select>
<ReeflowProvider authToken="your-token" theme={theme} themeMode={themeMode}>
{/* Your dashboard components */}
</ReeflowProvider>
</>
);
}

For fine-grained control over component appearance, use CSS custom properties (CSS variables) and CSS Parts.

CSS variables are the primary way to customize the SDK’s appearance. All components use these variables for colors, spacing, typography, and other visual properties.

VariableDescriptionDefault (Light)
--reeflow-bg-primaryPrimary background color for main areas#ffffff
--reeflow-bg-secondarySecondary background for headers and sections#f8fafc
--reeflow-bg-hoverBackground color for hover states#f8fafc
VariableDescriptionDefault (Light)
--reeflow-text-primaryPrimary text color for main content#374151
--reeflow-text-secondarySecondary text for less prominent content#6b7280
--reeflow-text-errorText color for error messages#dc2626
VariableDescriptionDefault (Light)
--reeflow-border-colorBorder color for all components#e2e8f0
VariableDescriptionDefault (Light)
--reeflow-accent-primaryPrimary accent for interactive elements#3b82f6
--reeflow-accent-primary-hoverAccent color for hover states#2563eb
VariableDescriptionDefault (Light)
--reeflow-chart-color-1First data series color#3b82f6 (blue)
--reeflow-chart-color-2Second data series color#8b5cf6 (purple)
--reeflow-chart-color-3Third data series color#ec4899 (pink)
--reeflow-chart-color-4Fourth data series color#f59e0b (amber)
--reeflow-chart-color-5Fifth data series color#10b981 (green)
--reeflow-chart-color-6Sixth data series color#06b6d4 (cyan)
--reeflow-chart-color-7Seventh data series color#f43f5e (rose)
--reeflow-chart-color-8Eighth data series color#6366f1 (indigo)
--reeflow-chart-grid-colorChart grid line color#e5e7eb
--reeflow-chart-axis-colorChart axis line and label color#9ca3af
--reeflow-chart-text-colorChart text elements#374151
--reeflow-chart-tooltip-bgTooltip background color#ffffff
--reeflow-chart-tooltip-borderTooltip border color#e5e7eb
--reeflow-chart-tooltip-textTooltip text color#374151
VariableDescriptionDefault
--reeflow-border-radiusStandard border radius for containers8px
--reeflow-border-radius-smSmall border radius for buttons4px
VariableDescriptionDefault
--reeflow-transitionStandard transition timingall 0.2s ease-in-out

Override variables for a single component:

reeflow-table {
--reeflow-bg-primary: #f5f5f5;
--reeflow-text-primary: #000000;
--reeflow-accent-primary: #ff6600;
--reeflow-border-radius: 12px;
}

Define custom variables globally for consistency:

:root {
--reeflow-accent-primary: #0066cc;
--reeflow-border-color: #e0e0e0;
--reeflow-border-radius: 8px;
}

Customize chart colors:

reeflow-bar-chart {
--reeflow-chart-color-1: #ff6b6b;
--reeflow-chart-color-2: #4ecdc4;
--reeflow-chart-color-3: #45b7d1;
--reeflow-chart-grid-color: #f0f0f0;
--reeflow-chart-tooltip-bg: #1a1a1a;
--reeflow-chart-tooltip-text: #ffffff;
}

Apply brand colors across multiple components:

:root {
--reeflow-accent-primary: #7c3aed;
--reeflow-accent-primary-hover: #6d28d9;
--reeflow-chart-color-1: #7c3aed;
--reeflow-chart-color-2: #06b6d4;
--reeflow-chart-color-3: #f59e0b;
}
reeflow-table::part(container),
reeflow-bar-chart::part(container) {
border: 1px solid var(--reeflow-border-color);
border-radius: var(--reeflow-border-radius);
}

All components expose CSS Parts for styling specific elements. Use CSS Parts when you need to style structural aspects that CSS variables don’t cover (like adding shadows, gradients, or complex layouts).

See the SDK Reference for a complete list of available parts for each component.

Example:

/* Style table container */
reeflow-table::part(container) {
border: 2px solid #e0e0e0;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
/* Style table title */
reeflow-table::part(title) {
color: #1a1a1a;
font-size: 20px;
font-weight: 700;
margin-bottom: 16px;
}
/* Style header cells */
reeflow-table::part(header-cell) {
background: #f5f5f5;
padding: 14px 16px;
font-weight: 600;
text-transform: uppercase;
font-size: 12px;
letter-spacing: 0.5px;
}
/* Style chart container */
reeflow-bar-chart::part(container) {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 24px;
border-radius: 16px;
}

Components are responsive by default, but you can enhance their behavior with CSS:

/* Stack components vertically on mobile */
@media (max-width: 768px) {
reeflow-bar-chart::part(container) {
margin-bottom: 24px;
}
}
/* Adjust chart heights for different screen sizes */
reeflow-bar-chart {
height: 300px;
}
@media (min-width: 768px) {
reeflow-bar-chart {
height: 400px;
}
}
@media (min-width: 1200px) {
reeflow-bar-chart {
height: 500px;
}
}

The built-in themes follow accessibility best practices:

  • Color contrast: All themes meet WCAG AA standards for text contrast
  • Focus indicators: Clear visual focus indicators for keyboard navigation
  • Screen reader support: Semantic HTML with appropriate ARIA attributes
  • Keyboard navigation: Full keyboard support for interactive elements

When creating custom styles, ensure you maintain these accessibility standards:

/* Maintain focus indicators */
reeflow-table::part(header-cell):focus-visible {
outline: 2px solid #0066cc;
outline-offset: 2px;
}
/* Ensure sufficient contrast */
reeflow-table::part(cell) {
color: #1a1a1a; /* High contrast text */
background: white;
}
reeflow-table::part(row):hover {
background: #f5f5f5; /* Subtle hover state */
}

Start with a built-in theme and customize only what you need. The themes are professionally designed and accessible.

Always test your customizations in both light and dark modes:

// Test theme modes programmatically
const provider = document.querySelector('reeflow-provider');
// Test light mode
provider.themeMode = 'light';
// Verify appearance
// Test dark mode
provider.themeMode = 'dark';
// Verify appearance

Prefer setting themes at the Provider level. Too many component-level overrides can create an inconsistent user experience.

When customizing multiple components, define CSS variables at a higher level:

:root {
--reeflow-primary-color: #0066cc;
--reeflow-border-color: #e0e0e0;
--reeflow-border-radius: 8px;
}
reeflow-table::part(container),
reeflow-bar-chart::part(container) {
border: 1px solid var(--reeflow-border-color);
border-radius: var(--reeflow-border-radius);
}

Ensure your custom styles work well on all screen sizes:

@media (max-width: 768px) {
reeflow-bar-chart {
/* Reduce height on mobile */
height: 250px;
}
}