Styling Basics V2 components

Customize the visual appearance of Basics V2 components using CSS variables.

Overview

Basics V2 components are styled entirely through CSS custom properties (CSS variables). Every color, spacing value, shadow, and typography setting is controlled by a variable prefixed with --flows-basicsV2-, making it straightforward to match the components to your product's design system.

There are two ways to customize the styles:

  1. Override CSS variables (recommended) - import the default stylesheet and override only the variables you want to change.
  2. Copy and modify the stylesheet - copy index.css from the package into your project and edit it directly.

The simplest approach is to override individual variables in your own CSS. By importing the override CSS file after the package's stylesheet, your variable values will take precedence while still inheriting any variables you don't override.

custom-flows.css
:root {
  /* Change the primary (button/accent) color to your brand color */
  --flows-basicsV2-bg-primary: #7c3aed;
  --flows-basicsV2-bg-primary-hover: #6d28d9;
  --flows-basicsV2-border-primary: 1px solid #7c3aed;

  /* Match your app's font */
  --flows-basicsV2-font-family: "Inter", sans-serif;

  /* Adjust border radius to match your design system */
  --flows-basicsV2-borderRadius-m: 6px;
  --flows-basicsV2-borderRadius-l: 10px;
  --flows-basicsV2-borderRadius-xl: 14px;
}

Import the overrides after the package stylesheet.

layout.tsx
import "@flows/react-components/index.css";
import "./custom-flows.css"; 

See CSS variable reference below for a full list of available variables.

Copying and modifying the stylesheet

If you need deeper control, copy the stylesheet directly into your project and edit the values there. You can find index.css in the installed package:

  • React: node_modules/@flows/react-components/dist/index.css
  • JavaScript: node_modules/@flows/js-components/dist/index.css

This approach is less maintainable, as you won't receive updates to the styles when the package is updated. We recommend only using this method if you need to make extensive changes that can't be achieved through variable overrides.

Copy the file to your project (for example, src/flows-components.css), then import your copy instead of the package's file:

layout.tsx
// Before
import "@flows/react-components/index.css";

// After
import "./flows-components.css";

Dark mode

The stylesheet ships with a .dark class selector that overrides all color variables for dark mode. To activate dark mode styles, add the dark class to a parent element, typically <html> or <body>:

<html class="dark">
  ...
</html>

To customize dark mode colors, override the variables inside your own .dark rule:

custom-flows.css
.dark {
  --flows-basicsV2-bg-primary: #a78bfa;
  --flows-basicsV2-bg-primary-hover: #8b5cf6;
  --flows-basicsV2-border-primary: 1px solid #a78bfa;
  --flows-basicsV2-fg-onPrimary: #1e1e1e;
}

If your app uses a different method for dark mode (e.g. a data-theme="dark" attribute or a different class name), you can change the selector in your own stylesheet to match your approach.

Example: matching a brand color

The following example changes the accent color from the default black/white to a purple brand color in both light and dark mode:

flows-theme.css
:root {
  --flows-basicsV2-bg-primary: #7c3aed;
  --flows-basicsV2-bg-primary-hover: #6d28d9;
  --flows-basicsV2-border-primary: 1px solid #7c3aed;
  --flows-basicsV2-fg-onPrimary: #ffffff;
}

.dark {
  --flows-basicsV2-bg-primary: #a78bfa;
  --flows-basicsV2-bg-primary-hover: #8b5cf6;
  --flows-basicsV2-border-primary: 1px solid #a78bfa;
  --flows-basicsV2-fg-onPrimary: #0f0f0f;
}

Import the overrides after the package stylesheet.

layout.tsx
import "@flows/react-components/index.css";
import "./flows-theme.css"; 

CSS variable reference

See the vars.css file in the Flows SDK GitHub repository for the full list of CSS variables.

Colors

These variables control backgrounds, text colors, borders, and overlays.

VariableLight defaultDark defaultDescription
--flows-basicsV2-bg-default#ffffff#1e1e1eMain component background
--flows-basicsV2-bg-subtle#fafafa#262626Subtle/secondary background
--flows-basicsV2-bg-strong#eaeaea#303030Strong background (e.g. progress bar track)
--flows-basicsV2-bg-hover#f0f0f0#333333Background on hover
--flows-basicsV2-bg-primary#262626#f1f1f1Primary accent background (buttons, hotspot)
--flows-basicsV2-bg-primary-hover#3b3b3b#ddddddPrimary background on hover
--flows-basicsV2-bg-overlayrgba(0,0,0,.4)rgba(0,0,0,.6)Overlay behind modals and tooltips
--flows-basicsV2-fg-default#1a1a1a#fafafaDefault text color
--flows-basicsV2-fg-onPrimary#ffffff#1e1e1eText color on primary backgrounds
--flows-basicsV2-fg-muted#605252#9d9595Muted/secondary text color
--flows-basicsV2-borderWidth1pxBorder width used in border shorthands
--flows-basicsV2-border1px solid #d6d6d61px solid #3d3d3dDefault border
--flows-basicsV2-border-strong1px solid #ccc1px solid #4a4a4aStrong border
--flows-basicsV2-border-strong-hover1px solid #bababa1px solid #616161Strong border on hover
--flows-basicsV2-border-primary1px solid #2626261px solid #f1f1f1Primary/accent border

Shadows

VariableDescription
--flows-basicsV2-shadowDefault drop shadow (used on tooltips, hints)
--flows-basicsV2-shadow-largeLarger drop shadow (used on modals and popovers)
--flows-basicsV2-primary-button-gradientGradient overlay on primary buttons
--flows-basicsV2-primary-button-shadowBox shadow on primary buttons
--flows-basicsV2-secondary-button-shadowBox shadow on secondary buttons

Border radius

VariableDefaultDescription
--flows-basicsV2-borderRadius-xs3pxExtra small radius (arrow corners)
--flows-basicsV2-borderRadius-m8pxMedium radius (buttons, checklist items)
--flows-basicsV2-borderRadius-l12pxLarge radius (tooltips, cards, popovers)
--flows-basicsV2-borderRadius-xl16pxExtra large radius (modals)

Spacing

These variables are used as internal padding and gap values throughout the components.

VariableDefaultDescription
--flows-basicsV2-size-xs2pxExtra small spacing
--flows-basicsV2-size-s8pxSmall spacing
--flows-basicsV2-size-m12pxMedium spacing
--flows-basicsV2-size-l16pxLarge spacing
--flows-basicsV2-size-xl20pxExtra large spacing
--flows-basicsV2-size-xxl24px2× extra large spacing

Typography

VariableDefaultDescription
--flows-basicsV2-font-familySystem font stackFont family for all component text
--flows-basicsV2-base-font-size14pxBody text font size
--flows-basicsV2-base-line-height20pxBody text line height
--flows-basicsV2-title-font-size16pxTitle font size
--flows-basicsV2-title-line-height24pxTitle line height
--flows-basicsV2-title-font-weight600Title font weight

Z-index

VariableDefaultDescription
--flows-basicsV2-zIndex1500Stack order for floating components

Buttons

VariableDefaultDescription
--flows-basicsV2-button-font-size15pxDefault button font size
--flows-basicsV2-button-line-height24pxDefault button line height
--flows-basicsV2-button-small-font-size14pxSmall button font size
--flows-basicsV2-button-small-line-height20pxSmall button line height

Progress indicators

Tour step indicators used in Tooltip, Hint, and Modal components.

VariableDefaultDescription
--flows-basicsV2-progress-dots-size10pxDiameter of each progress dot
--flows-basicsV2-progress-dots-gap6pxGap between progress dots

Tooltip

Tooltip and Hint specific variables.

VariableDefaultDescription
--flows-basicsV2-tooltip-padding20pxInner padding of tooltip content
--flows-basicsV2-tooltip-minWidth200pxMinimum tooltip width
--flows-basicsV2-tooltip-maxWidth320pxMaximum tooltip width
--flows-basicsV2-tooltip-overlayBackgroundInherits bg-overlaySpotlight overlay color
--flows-basicsV2-tooltip-overlayBorderRadiusInherits borderRadius-mSpotlight overlay corner radius
--flows-basicsV2-tooltip-overlayPadding4pxPadding between element and spotlight cutout

Modal specific variables.

VariableDefaultDescription
--flows-basicsV2-modal-padding24pxInner padding of modal content
--flows-basicsV2-modal-minWidth320pxMinimum modal width (auto sizing)
--flows-basicsV2-modal-maxWidth640pxMaximum modal width (auto sizing)
--flows-basicsV2-modal-size-small420pxWidth of small-sized modal
--flows-basicsV2-modal-size-medium640pxWidth of medium-sized modal
--flows-basicsV2-modal-button-max-width600pxMaximum width of the button row
--flows-basicsV2-modal-overlayBackgroundInherits bg-overlayModal backdrop color

Card

Card specific variables.

VariableDefaultDescription
--flows-basicsV2-card-padding20pxInner padding of card content

Floating Checklist

Floating Checklist specific variables.

VariableDefaultDescription
--flows-basicsV2-floating-checklist-popover-maxWidth340pxMaximum width of the checklist popover
--flows-basicsV2-floating-checklist-scrollbar-color#d6d6d6 transparentScrollbar thumb and track colors

Individual component styles

Each component also has a set of styles for more granular control. These styles try to use CSS variables where possible but may include some hardcoded values. You can override these styles by targeting the component's class names in your CSS.

To find the relevant class names, inspect the component in your browser's developer tools and look for classes prefixed with flows-basicsV2-, or search for them in the index.css file. For example, to change the border radius of the Modal component, you could add:

custom-flows.css
.flows_basicsV2_modal_modal {
  border-radius: 20px;
}

On this page