SurveyJS Design Tokens — CSS-Based Customization

SurveyJS themes use a unified design token system that allows you to style all four SurveyJS products—Form Library, Survey Creator, Dashboard, and PDF Generator—using the same set of CSS variables.

The design token system is organized into the following layers:

This guide starts with a quick customization example and then explains the design token architecture layer by layer.

Most customizations should be done through semantic tokens (Layer 3) and individual component tokens (Layer 4). Semantic tokens describe UI intent instead of raw values, which makes it possible to restyle large parts of the UI by overriding only a few variables. Individual component tokens allow you to customize specific UI elements without affecting the rest of the design system.

Quick Customization Example

The following example changes the primary brand color, surface colors, and typography. The applyTheme method is available in Form Library, Survey Creator, Dashboard, and PDF Generator.

const customTheme = {
  "cssVariables": {
    // Primary brand color used across actions and interactive controls
    "--sjs2-color-project-brand-600": "#085DE5",

    // Main application surfaces
    "--sjs2-color-bg-basic-primary": "#F2F2F2",
    "--sjs2-color-bg-basic-secondary": "#E8EAEB",

    // Typography settings
    "--sjs2-typography-font-family-text": "Inter, sans-serif",
    "--sjs2-typography-font-size-default": "var(--sjs2-font-size-x250)"
  }
};

survey.applyTheme(customTheme);

creator.applyCreatorTheme(customTheme); // Apply to Survey Creator UI
creator.applyTheme(customTheme); // Apply to the survey being configured

dashboard.applyTheme(customTheme);

surveyPdf.applyTheme(customTheme);

All CSS customizations are applied over the Default Light theme. To customize another built-in theme, pass its object as the second parameter to the applyTheme method:

import { LayeredDarkPanelless } from "survey-core/themes";

const customTheme = {
  "cssVariables": {
    "--sjs2-color-project-brand-600": "#19B394"
  }
};

survey.applyTheme(customTheme, LayeredDarkPanelless);

Layer 0 – Palette

Palette contains primitive tokens that define raw color material used by the designing system.

View Palette Scale
Variable Value
--sjs2-palette-gray-100 #F5F5F5
--sjs2-palette-gray-150 #EDEDED
--sjs2-palette-gray-200 #E5E5E5
--sjs2-palette-gray-250 #D4D4D4
--sjs2-palette-gray-300 #CDCDCD
--sjs2-palette-gray-400 #B3B2B2
--sjs2-palette-gray-500 #8E8E8E
--sjs2-palette-gray-600 #656468
--sjs2-palette-gray-650 #565558
--sjs2-palette-gray-700 #414045
--sjs2-palette-gray-750 #36353C
--sjs2-palette-gray-800 #2D2C33
--sjs2-palette-gray-850 #222126
--sjs2-palette-gray-900 #1C1B20
--sjs2-palette-gray-950 #161519
--sjs2-palette-gray-999 #111014
--sjs2-palette-gray-000 #fff
--sjs2-palette-red-400 #ff6e84
--sjs2-palette-red-600 #E50A3E
--sjs2-palette-red-700 #C30935
--sjs2-palette-green-400 #15CDAB
--sjs2-palette-green-600 #19B394
--sjs2-palette-green-700 #15947A
--sjs2-palette-blue-400 #66B4FC
--sjs2-palette-blue-600 #437FD9
--sjs2-palette-blue-700 #2A6CD0
--sjs2-palette-yellow-400 #FEC64A
--sjs2-palette-yellow-600 #FF9814
--sjs2-palette-yellow-700 #F08700
--sjs2-palette-violet-400 #C36FF4
--sjs2-palette-violet-600 #A62CEC
--sjs2-palette-violet-700 #9614E1
--sjs2-palette-olive-400 #6FC648
--sjs2-palette-olive-600 #4FAF24
--sjs2-palette-olive-700 #41901E
--sjs2-palette-purple-400 #A190FA
--sjs2-palette-purple-600 #6E5BD1
--sjs2-palette-purple-700 #5640C9
--sjs2-palette-indianred-400 #F9786A
--sjs2-palette-indianred-600 #AF496B
--sjs2-palette-indianred-700 #973F5C

Layer 1 – Base Tokens

Base tokens define the primitive scales used to generate the rest of the design system. These tokens control spacing, sizing, typography rhythm, border radii, and opacity calculations.

In most cases, you should customize semantic tokens instead of base tokens. Override base tokens only when you want to globally change the visual scale of the entire UI, for example:

  • Increase all spacing and paddings across the UI.
  • Make all controls more rounded.
  • Increase the default typography scale.
  • Increase the size of interactive elements.

Sizing & Spacing Units

Variable Base value Role Affects
--sjs2-base-unit-size 8px Base size unit Control heights, icon sizes, layout dimensions
--sjs2-base-unit-spacing 8px Base spacing unit Margins, paddings, gaps, layout spacing

Shape & Borders

Variable Base value Role Affects
--sjs2-base-unit-radius 8px Border radius base Corner rounding across components
--sjs2-base-unit-border-width 1px Border width base All derived border width scales

Typography Units

Variable Base value Role Affects
--sjs2-base-unit-font-size 8px Font size scale base All derived typography sizes
--sjs2-base-unit-line-height 8px Line height scale base Text rhythm and vertical spacing

Effects

Variable Base value Role Affects
--sjs2-base-unit-opacity 1% Opacity scale base Transparency scales and overlays
--sjs2-base-unit-scale 1% Transform scale base Transform-based interaction states

Layer 2 – System Primitives

System primitives are generated scales derived from base tokens. These tokens should not be overridden directly.

Typography scale
Variable Value / Derived from Role
--sjs2-font-weight-regular 400 Normal text weight
--sjs2-font-weight-medium 500 Medium emphasis weight
--sjs2-font-weight-semibold 600 Semi-bold emphasis weight
--sjs2-font-weight-bold 700 Bold text weight
--sjs2-font-size-x000 base-unit-font-size × 0 Zero font size (utility/reset value)
--sjs2-font-size-x100 base-unit-font-size × 1 Base font size step
--sjs2-font-size-x150 base-unit-font-size × 1.5 Slightly larger small text
--sjs2-font-size-x200 base-unit-font-size × 2 Small body text size
--sjs2-font-size-x250 base-unit-font-size × 2.5 Intermediate font size step
--sjs2-font-size-x300 base-unit-font-size × 3 Default body text size
--sjs2-font-size-x350 base-unit-font-size × 3.5 Large body / small heading size
--sjs2-font-size-x400 base-unit-font-size × 4 Heading size
--sjs2-font-size-x500 base-unit-font-size × 5 Large heading size
--sjs2-font-size-x600 base-unit-font-size × 6 Display / very large heading size
--sjs2-line-height-x000 base-unit-line-height × 0 Zero line height (utility/reset)
--sjs2-line-height-x100 base-unit-line-height × 1 Tight line height
--sjs2-line-height-x200 base-unit-line-height × 2 Small text line height
--sjs2-line-height-x300 base-unit-line-height × 3 Default body line height
--sjs2-line-height-x400 base-unit-line-height × 4 Medium text line height
--sjs2-line-height-x500 base-unit-line-height × 5 Large text line height
--sjs2-line-height-x600 base-unit-line-height × 6 Extra-large text line height
--sjs2-text-case-default "none" Default text casing (no transformation)
--sjs2-text-case-uppercase "uppercase" Uppercase text transformation
Spacing scale
Variable Derived from Role
--sjs2-spacing-x000 base-unit-spacing × 0 Zero spacing (no gap)
--sjs2-spacing-x025 base-unit-spacing × 0.25 Extra-small spacing increment
--sjs2-spacing-x050 base-unit-spacing × 0.50 Small spacing increment
--sjs2-spacing-x075 base-unit-spacing × 0.75 Medium-small spacing increment
--sjs2-spacing-x100 base-unit-spacing × 1 Base spacing unit
--sjs2-spacing-x150 base-unit-spacing × 1.5 Slightly larger spacing step
--sjs2-spacing-x200 base-unit-spacing × 2 Medium spacing
--sjs2-spacing-x250 base-unit-spacing × 2.5 Medium-large spacing increment
--sjs2-spacing-x300 base-unit-spacing × 3 Large spacing
--sjs2-spacing-x400 base-unit-spacing × 4 Extra-large spacing
--sjs2-spacing-x500 base-unit-spacing × 5 Section spacing
--sjs2-spacing-x550 base-unit-spacing × 5.5 Large section spacing variant
--sjs2-spacing-x600 base-unit-spacing × 6 Very large spacing
--sjs2-spacing-x700 base-unit-spacing × 7 Layout-level spacing
--sjs2-spacing-x800 base-unit-spacing × 8 Maximum standard spacing scale
--sjs2-spacing-negative-x025 base-unit-spacing × -0.25 Negative spacing (tight adjustment)
--sjs2-spacing-negative-x050 base-unit-spacing × -0.50 Negative spacing (small overlap)
--sjs2-spacing-negative-x075 base-unit-spacing × -0.75 Negative spacing (medium overlap)
--sjs2-spacing-negative-x100 base-unit-spacing × -1 Base negative spacing
--sjs2-spacing-negative-x150 base-unit-spacing × -1.5 Increased negative spacing
--sjs2-spacing-negative-x200 base-unit-spacing × -2 Large negative spacing
--sjs2-spacing-negative-x250 base-unit-spacing × -2.5 Larger negative spacing
--sjs2-spacing-negative-x300 base-unit-spacing × -3 Extra-large negative spacing
--sjs2-spacing-negative-x400 base-unit-spacing × -4 Heavy overlap spacing
--sjs2-spacing-negative-x500 base-unit-spacing × -5 Strong layout compression
--sjs2-spacing-negative-x600 base-unit-spacing × -6 Very strong negative spacing
--sjs2-spacing-negative-x700 base-unit-spacing × -7 Extreme negative spacing
--sjs2-spacing-negative-x800 base-unit-spacing × -8 Maximum negative spacing scale
Sizing scale
Variable Derived from Role
--sjs2-size-x000 base-unit-size × 0 Zero size (reset/utility)
--sjs2-size-x025 base-unit-size × 0.25 Minimal size increment
--sjs2-size-x050 base-unit-size × 0.50 Very small size
--sjs2-size-x075 base-unit-size × 0.75 Small size adjustment
--sjs2-size-x100 base-unit-size × 1 Base size unit
--sjs2-size-x150 base-unit-size × 1.5 Slightly enlarged size
--sjs2-size-x200 base-unit-size × 2 Small component size
--sjs2-size-x250 base-unit-size × 2.5 Medium-small size
--sjs2-size-x300 base-unit-size × 3 Medium size
--sjs2-size-x350 base-unit-size × 3.5 Medium-large size
--sjs2-size-x400 base-unit-size × 4 Large component size
--sjs2-size-x500 base-unit-size × 5 Extra-large size
--sjs2-size-x600 base-unit-size × 6 Section-level size
--sjs2-size-x700 base-unit-size × 7 Layout-level size
--sjs2-size-x800 base-unit-size × 8 Large layout size
--sjs2-size-x900 base-unit-size × 9 Very large size
--sjs2-size-x1000 base-unit-size × 10 Maximum standard scale size
--sjs2-size-x1100 base-unit-size × 11 Extended large size
--sjs2-size-x1200 base-unit-size × 12 Extra-large layout size
--sjs2-size-x1300 base-unit-size × 13 Oversized component scale
--sjs2-size-x1400 base-unit-size × 14 Very oversized scale
--sjs2-size-x1500 base-unit-size × 15 Maximum size scale
--sjs2-scale-x000 base-unit-scale × 0 Zero scale (disabled/hidden)
--sjs2-scale-x025 base-unit-scale × 25 Very low scale
--sjs2-scale-x050 base-unit-scale × 50 Reduced scale
--sjs2-scale-x075 base-unit-scale × 75 Slightly reduced scale
--sjs2-scale-x095 base-unit-scale × 95 Near-normal scale (slightly reduced)
--sjs2-scale-x098 base-unit-scale × 98 Almost full scale
--sjs2-scale-x100 base-unit-scale × 100 Normal scale (baseline)
--sjs2-scale-x200 base-unit-scale × 200 Double scale (zoomed/enlarged state)
Border and radius scales
Variable Value / Derived from Role
--sjs2-border-width-x000 base-unit-border-width × 0 No border (none/hidden)
--sjs2-border-width-x100 base-unit-border-width × 1 Default border width
--sjs2-border-width-x200 base-unit-border-width × 2 Medium border width
--sjs2-border-width-x400 base-unit-border-width × 4 Thick border width
--sjs2-radius-x000 base-unit-radius × 0 No corner rounding (sharp corners)
--sjs2-radius-x025 base-unit-radius × 0.25 Minimal corner rounding
--sjs2-radius-x050 base-unit-radius × 0.50 Small corner rounding
--sjs2-radius-x075 base-unit-radius × 0.75 Slight corner rounding
--sjs2-radius-x100 base-unit-radius × 1 Default corner radius
--sjs2-radius-x150 base-unit-radius × 1.5 Medium corner rounding
--sjs2-radius-x200 base-unit-radius × 2 Large corner rounding
--sjs2-radius-x250 base-unit-radius × 2.5 Extra-large corner rounding
--sjs2-radius-x300 base-unit-radius × 3 Very large corner rounding
--sjs2-radius-x400 base-unit-radius × 4 Highly rounded corners
--sjs2-radius-x500 base-unit-radius × 5 Very high rounding
--sjs2-radius-x600 base-unit-radius × 6 Extreme rounding
--sjs2-radius-x700 base-unit-radius × 7 Near-pill shape
--sjs2-radius-x800 base-unit-radius × 8 Pill-like rounding
--sjs2-radius-round "9999px" Fully rounded (circle/pill shape)
Opacity scale
Variable Derived from Role
--sjs2-opacity-x000 base-unit-opacity × 0 Fully transparent
--sjs2-opacity-x005 base-unit-opacity × 5 Nearly invisible
--sjs2-opacity-x010 base-unit-opacity × 10 Very low visibility
--sjs2-opacity-x015 base-unit-opacity × 15 Low visibility
--sjs2-opacity-x020 base-unit-opacity × 20 Low-medium visibility
--sjs2-opacity-x025 base-unit-opacity × 25 Light transparency
--sjs2-opacity-x030 base-unit-opacity × 30 Slightly visible transparency
--sjs2-opacity-x035 base-unit-opacity × 35 Subtle transparency step
--sjs2-opacity-x040 base-unit-opacity × 40 Mild transparency
--sjs2-opacity-x045 base-unit-opacity × 45 Medium-low transparency
--sjs2-opacity-x050 base-unit-opacity × 50 50% transparency (balanced)
--sjs2-opacity-x055 base-unit-opacity × 55 Slightly more opaque than midpoint
--sjs2-opacity-x060 base-unit-opacity × 60 Medium visibility
--sjs2-opacity-x065 base-unit-opacity × 65 Medium-high visibility
--sjs2-opacity-x070 base-unit-opacity × 70 High visibility
--sjs2-opacity-x075 base-unit-opacity × 75 Very high visibility
--sjs2-opacity-x080 base-unit-opacity × 80 Mostly opaque
--sjs2-opacity-x085 base-unit-opacity × 85 High opacity
--sjs2-opacity-x090 base-unit-opacity × 90 Very high opacity
--sjs2-opacity-x095 base-unit-opacity × 95 Near fully opaque
--sjs2-opacity-x100 base-unit-opacity × 100 Fully opaque

Layer 3 – Semantic Tokens

Semantic tokens are the primary theming API. They describe UI intent rather than raw values.

For example:

  • --sjs2-color-bg-brand-primary describes a primary brand-colored surface.
  • --sjs2-color-fg-basic-secondary describes medium-emphasis text.
  • --sjs2-radius-form describes the default rounding used for form controls.

Semantic tokens automatically propagate across the UI wherever that semantic role is used.

Semantic Token Naming System

Most semantic tokens follow this naming pattern:

--sjs2-[domain]-[subdomain]-[role]-[variant]-[modifier]

Not every token includes all segments, but the segment order is always preserved.

Domains & Subdomains

Domains organize tokens by their purpose.

Domain Main subdomains Purpose
color bg, fg, border Colors for backgrounds, text, borders, icons, and states
typography font-family, font-size, font-weight, line-height Font families, sizes, weights, and line heights
radius form, form-item Corner rounding
opacity Visibility and transparency
border-effect surface, trigger, floating Shadow- and outline-based interaction and elevation effects

Roles

Roles define the semantic purpose of a token within the interface.

Color Roles

Role Meaning
brand Primary branded interactive surfaces and accents
basic Default UI surfaces, text, and borders
neutral High-contrast non-branded actions and utility elements
note Informational and non-critical messaging
positive Success, confirmation, and completed states
warning Attention and caution-related states
alert Errors, destructive actions, and validation states
static Fixed contrast pairs that remain unchanged across themes
utility Application-level surfaces, overlays, and shadows

Typography Roles

Role Meaning
text Standard UI typography
code Monospaced typography for code and technical content

Variants

Variants define emphasis levels.

Color Variants

Variant Meaning
primary Main emphasis
secondary Reduced emphasis
tertiary Low emphasis
on-primary Foreground content displayed on a primary-colored background

Typography Variants

Variant Meaning
small Small supporting or footnote text
default Standard body text size or rhythm
medium Medium-emphasis text such as subheadings
large Large-emphasis text such as headings
basic Default font weight
strong Emphasized font weight

Modifiers

Modifiers define interaction states, emphasis adjustments, or contextual variations applied to a token.

Color Modifiers

Modifier Meaning
muted De-emphasized appearance
dim Hovered, pressed, or stronger-emphasis state
disabled Non-interactive or unavailable state

Colors

Brand

Brand color tokens define the primary accent color used throughout the SurveyJS UI.

Changing the brand color updates:

  • Brand-colored buttons
  • Selected controls
  • Input field focus indicators
  • Progress indicators
  • Interactive accents

Core Brand Colors

The core brand colors define the foundation for all brand-related semantic tokens.

Variable Derived from Role Affects
color-project-brand-600 Base brand color Backgrounds of primary interactive elements (buttons, selections, highlights)
color-project-brand-700 color-project-brand-600 (-15% L) Dark brand variation Primary interactive foregrounds, hover and pressed states for brand backgrounds
color-project-brand-800 color-project-brand-600 (-25% L) Strong brand variation Hover and pressed states for brand foregrounds
color-project-brand-400 color-project-brand-600 (+20% L) Light brand variation Primary interactive foregrounds on dark surfaces

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the base brand color
    "--sjs2-color-project-brand-600": "#C003DD"
  }
});

Brand Backgrounds

Brand background tokens define surfaces and fills used for brand-colored UI elements.

Variable Derived from Role Affects
color-bg-brand-primary color-project-brand-600 Primary background Primary buttons, selected controls, active highlights
color-bg-brand-secondary color-project-brand-600, opacity-x010 Low-emphasis background Soft brand-tinted surfaces
color-bg-brand-tertiary color-project-brand-600, opacity-x000 Transparent variant Very subtle overlays, usually colored on hover only
color-bg-brand-primary-dim color-project-brand-700 Dimmed primary Hover and pressed brand surfaces, stronger emphasis states
color-bg-brand-secondary-dim color-project-brand-600, opacity-x015 Dimmed secondary Hover and pressed states for secondary backgrounds
color-bg-brand-tertiary-dim color-project-brand-600, opacity-x010 Dimmed tertiary Hover and pressed states for tertiary backgrounds
color-bg-brand-primary-disabled palette-gray-100 Disabled primary Disabled brand controls and inactive surfaces

Brand Foregrounds

Brand foreground tokens define text and icon colors used in brand-colored contexts.

Variable Derived from Role Affects
color-fg-brand-primary color-project-brand-700 Primary text and icons Text and icons on secondary and tertiary brand surfaces, main emphasis content, actions and links
color-fg-brand-primary-dim color-project-brand-800 Dimmed primary Hover and pressed states for primary text and icons, actions and links
color-fg-brand-on-primary palette-gray-000 Contrast on brand background Text and icons on primary brand backgrounds, such as actions/buttons
color-fg-brand-primary-disabled color-fg-neutral-primary, opacity-x020 Disabled primary Disabled text and icons in brand-styled components

Brand Borders

Brand border tokens define border colors used for brand-colored interactive elements and emphasis states.

Variable Derived from Role Affects
color-border-brand-primary color-project-brand-600 Brand primary Brand borders (e.g., borders of input fields in focused state)
color-border-brand-on-primary palette-gray-000 Brand on primary Border color on brand primary backgrounds

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the brand primary colors
    "--sjs2-color-bg-brand-primary": "#C003DD",
    "--sjs2-color-fg-brand-primary": "#5B0495",
    "--sjs2-color-border-brand-primary": "#126DFF"
  }
});

Basic

Basic tokens define the default visual foundation used across the SurveyJS UI. These tokens control standard surfaces, text hierarchy, and borders used in forms, containers, and interactive controls.

Basic Backgrounds

Basic backgrounds define the default UI backgrounds used throughout forms, containers, and controls.

Variable Derived from Role Affects
color-bg-basic-primary palette-gray-000 Primary, base Question panels, primary cards, toast notifications
color-bg-basic-secondary palette-gray-100 Secondary Input fields, unselected checkboxes, radio buttons, and toggles, secondary cards
color-bg-basic-tertiary palette-gray-150 Tertiary Tertiary cards
color-bg-basic-primary-dim palette-gray-100 Dimmed primary Hover and pressed states of primary cards
color-bg-basic-secondary-dim palette-gray-150 Dimmed secondary Hover and pressed states of input fields and unchecked controls
color-bg-basic-tertiary-dim palette-gray-200 Dimmed tertiary Hover and pressed states of tertiary cards
color-bg-basic-primary-disabled palette-gray-100 Disabled primary Disabled state for basic backgrounds

Basic Foregrounds

These tokens define the default foreground hierarchy used throughout the UI.

Variable Derived from Role Affects
color-fg-basic-primary palette-gray-900 High emphasis Primary texts, titles and values across the UI, selected states
color-fg-basic-secondary color-fg-basic-primary, opacity-x060 Medium emphasis Secondary labels, descriptions, icons
color-fg-basic-tertiary color-fg-basic-primary, opacity-x040 Low emphasis Tertiary texts and icons, unselected states
color-fg-basic-primary-muted color-fg-basic-primary, opacity-x080 Muted primary Primary icons, selected states
color-fg-basic-primary-disabled opacity-x020 Disabled primary Disabled primary texts and icons, disabled selected states
color-fg-basic-secondary-disabled opacity-x020 Disabled secondary Disabled secondary texts and icons
color-fg-basic-tertiary-disabled opacity-x020 Disabled tertiary Disabled tertiary texts and icons, disabled unselected states

Basic Borders

Basic border tokens define the default border hierarchy used across SurveyJS components.

Variable Derived from Role Affects
color-border-basic-primary palette-gray-900 Basic primary High-contrast borders (e.g., borders of highlighted input fields)
color-border-basic-secondary palette-gray-250 Basic secondary Default borders across all components
color-border-basic-secondary-overlay color-border-basic-primary, opacity-x040 Basic secondary overlay Default borders in overlay mode
color-border-basic-secondary-disabled palette-gray-100 Basic secondary disabled Disabled color for default borders

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the basic primary colors
    "--sjs2-color-bg-basic-primary": "#FEFEFE",
    "--sjs2-color-fg-basic-primary": "#000000",
    "--sjs2-color-border-basic-primary": "#001536"
  }
});

Neutral

Neutral tokens define high-contrast, non-brand visual styles used for generic actions, overlays, and utility UI elements.

Neutral Backgrounds

Neutral backgrounds provide high-contrast backgrounds independent of the primary brand color.

Variable Derived from Role Affects
color-bg-neutral-primary palette-gray-900 Primary Neutral primary actions, tooltips
color-bg-neutral-secondary palette-gray-100 Secondary Neutral secondary actions
color-bg-neutral-tertiary palette-gray-600, opacity-x000 Transparent Neutral tertiary actions
color-bg-neutral-primary-dim palette-gray-700 Dimmed primary Hover and pressed states for neutral primary backgrounds
color-bg-neutral-secondary-dim palette-gray-150 Dimmed secondary Hover and pressed states for neutral secondary backgrounds
color-bg-neutral-tertiary-dim palette-gray-600, opacity-x010 Dimmed tertiary Hover and pressed states for neutral tertiary backgrounds
color-bg-neutral-primary-disabled palette-gray-100 Disabled primary Disabled states for neutral backgrounds

Neutral Foregrounds

Neutral foreground tokens provide contrast-safe foreground colors for neutral backgrounds.

Variable Derived from Role Affects
color-fg-neutral-primary color-fg-basic-primary Primary Action labels on neutral secondary and tertiary backgrounds
color-fg-neutral-primary-muted color-fg-basic-primary-muted Muted primary Action icons on neutral secondary and tertiary backgrounds
color-fg-neutral-on-primary palette-gray-000 Neutral on primary Text and icons of actions and tooltips on neutral primary backgrounds
color-fg-neutral-primary-disabled opacity-x020 Disabled primary Disabled text and icons on neutral backgrounds

Neutral Borders

Neutral border tokens define border colors used on neutral surfaces and high-contrast UI elements.

Variable Derived from Role Affects
color-border-neutral-primary palette-gray-000 Neutral primary High-contrast inverted borders
color-border-neutral-on-primary palette-gray-000 Neutral on primary Border color on neutral primary backgrounds

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the neutral primary colors
    "--sjs2-color-bg-neutral-primary": "#131D37",
    "--sjs2-color-fg-neutral-primary": "#000000",
    "--sjs2-color-border-neutral-primary": "#D8E1F0"
  }
});

Note (Informational)

Note tokens define informational and non-critical visual styles used for guidance, contextual messaging, and informational actions.

Note Backgrounds

Note surfaces define informational and non-critical contextual backgrounds.

Variable Derived from Role Affects
color-bg-note-primary palette-blue-600 Primary Primary informational messages, actions in the Survey Creator's Logic tab
color-bg-note-secondary palette-blue-600, opacity-x010 Secondary Secondary informational messages, actions in the Logic tab
color-bg-note-tertiary palette-blue-600, opacity-x000 Transparent Tertiary informational messages
color-bg-note-primary-dim palette-blue-700 Dimmed primary Hover and pressed states for note primary backgrounds
color-bg-note-secondary-dim palette-blue-600, opacity-x015 Dimmed secondary Hover and pressed states for note secondary backgrounds
color-bg-note-tertiary-dim palette-blue-600, opacity-x010 Dimmed tertiary Hover and pressed states for note tertiary backgrounds
color-bg-note-primary-disabled palette-gray-100 Disabled primary Disabled states for note backgrounds

Note Foregrounds

Note foreground tokens define foreground colors for informational and non-critical messaging and serve as an additional color option where semantic usage is not important.

Variable Derived from Role Affects
color-fg-note-primary palette-blue-700 Primary Text and icons of actions, messages, and indicators on note secondary and tertiary backgrounds
color-fg-note-on-primary palette-gray-000 Note on primary Text and icons of actions, messages, indicators on note primary backgrounds
color-fg-note-primary-disabled color-fg-neutral-primary, opacity-x020 Disabled primary Disabled text and icons on note backgrounds

Note Borders

Note border tokens define border colors used for informational messages, indicators, and note-styled components.

Variable Derived from Role Affects
color-border-note-primary palette-blue-600 Note primary Note borders (e.g., borders of informational messages or indicators)
color-border-note-on-primary palette-gray-000 Note on primary Border color on note primary backgrounds

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the note primary colors
    "--sjs2-color-bg-note-primary": "#D278F9",
    "--sjs2-color-fg-note-primary": "#6901E7",
    "--sjs2-color-border-note-primary": "#8B2BE2"
  }
});

Positive

Positive tokens define success-related visual styles used for confirmations, completed states, and positive feedback.

Positive Backgrounds

Positive (success) background tokens are used for positive states, confirmations, and completed actions.

Variable Derived from Role Affects
color-bg-positive-primary palette-green-600 Primary Positive primary actions, messages, indicators
color-bg-positive-secondary palette-green-600, opacity-x010 Secondary Positive secondary actions, messages, indicators
color-bg-positive-tertiary palette-green-600, opacity-x000 Transparent Positive tertiary actions, messages, indicators
color-bg-positive-primary-dim palette-green-700 Dimmed primary Hover and pressed states for positive primary backgrounds
color-bg-positive-secondary-dim palette-green-600, opacity-x015 Dimmed secondary Hover and pressed states for positive secondary backgrounds
color-bg-positive-tertiary-dim palette-green-600, opacity-x010 Dimmed tertiary Hover and pressed states for positive tertiary backgrounds
color-bg-positive-primary-disabled palette-gray-100 Disabled primary Disabled states for positive backgrounds

Positive Foregrounds

Positive (success) foreground tokens define text and icon colors for positive feedback states.

Variable Derived from Role Affects
color-fg-positive-primary palette-green-700 Primary Text and icons of actions, messages, and indicators on positive secondary and tertiary backgrounds
color-fg-positive-on-primary palette-gray-000 Positive on primary Text and icons of actions, messages, and indicators on positive primary backgrounds
color-fg-positive-primary-disabled color-fg-neutral-primary, opacity-x020 Disabled primary Disabled text and icons on positive backgrounds

Positive Borders

Positive border tokens define border colors used for success messages, confirmations, and positive indicators.

Variable Derived from Role Affects
color-border-positive-primary palette-green-600 Positive (success) primary Positive borders (e.g., borders of success messages or indicators)
color-border-positive-on-primary palette-gray-000 Positive on primary Border color on positive primary backgrounds

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the positive primary colors
    "--sjs2-color-bg-positive-primary": "#43C43F",
    "--sjs2-color-fg-positive-primary": "#36A732",
    "--sjs2-color-border-positive-primary": "#2E922B"
  }
});

Warning

Warning tokens define cautionary visual styles used for attention-requiring states and non-critical issues.

Warning Backgrounds

Warning background tokens are used for cautionary and attention-requiring states.

Variable Derived from Role Affects
color-bg-warning-primary palette-yellow-600 Primary Warning primary actions, messages, indicators
color-bg-warning-secondary palette-yellow-600, opacity-x010 Secondary Warning secondary actions, messages, indicators
color-bg-warning-tertiary palette-yellow-600, opacity-x000 Transparent Warning tertiary actions, messages, indicators
color-bg-warning-primary-dim palette-yellow-700 Dimmed primary Hover and pressed states for warning primary backgrounds
color-bg-warning-secondary-dim palette-yellow-600, opacity-x015 Dimmed secondary Hover and pressed states for warning secondary backgrounds
color-bg-warning-tertiary-dim palette-yellow-600, opacity-x010 Dimmed tertiary Hover and pressed states for warning tertiary backgrounds
color-bg-warning-primary-disabled palette-gray-100 Disabled primary Disabled states for warning backgrounds

Warning Foregrounds

Warning foreground tokens define text and icon colors for warning states.

Variable Derived from Role Affects
color-fg-warning-primary palette-yellow-700 Primary Text and icons of actions, messages, and indicators on warning secondary and tertiary backgrounds
color-fg-warning-on-primary palette-gray-000 Warning on primary Text and icons of actions, messages, and indicators on warning primary backgrounds
color-fg-warning-primary-disabled color-fg-neutral-primary, opacity-x020 Disabled primary Disabled text and icons on warning backgrounds

Warning Borders

Warning border tokens define border colors used for warning messages, caution indicators, and attention states.

Variable Derived from Role Affects
color-border-warning-primary palette-yellow-600 Warning primary Warning borders (e.g., borders of warning messages or indicators)
color-border-warning-on-primary palette-gray-000 Warning on primary Border color on warning primary backgrounds

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the warning primary colors
    "--sjs2-color-bg-warning-primary": "#FFBD09",
    "--sjs2-color-fg-warning-primary": "#E2A500",
    "--sjs2-color-border-warning-primary": "#C98D00"
  }
});

Alert

Alert tokens define destructive and error-related visual styles used for validation errors, destructive actions, and critical feedback.

Alert Backgrounds

Alert background tokens are used for destructive, invalid, and error-related states.

Variable Derived from Role Affects
color-bg-alert-primary palette-red-600 Primary Alert primary actions, messages, indicators
color-bg-alert-secondary palette-red-600, opacity-x010 Secondary Alert secondary actions, messages, indicators
color-bg-alert-tertiary palette-red-600, opacity-x000 Transparent Alert tertiary actions, messages, indicators
color-bg-alert-primary-dim palette-red-700 Dimmed primary Hover and pressed states for alert primary backgrounds
color-bg-alert-secondary-dim palette-red-600, opacity-x015 Dimmed secondary Hover and pressed states for alert secondary backgrounds
color-bg-alert-tertiary-dim palette-red-600, opacity-x010 Dimmed tertiary Hover and pressed states for alert tertiary backgrounds
color-bg-alert-primary-disabled palette-gray-100 Disabled primary Disabled states for alert backgrounds

Alert Foregrounds

Alert foreground tokens define text and icon colors for destructive and error states.

Variable Derived from Role Affects
color-fg-alert-primary palette-red-700 Primary Text and icons of actions, messages, and indicators on alert secondary and tertiary backgrounds
color-fg-alert-on-primary palette-gray-000 Alert on primary Text and icons of actions, messages, and indicators on alert primary backgrounds
color-fg-alert-primary-disabled color-fg-neutral-primary, opacity-x020 Disabled primary Disabled text and icons on alert backgrounds

Alert Borders

Alert border tokens define border colors used for error states, destructive actions, and validation indicators.

Variable Derived from Role Affects
color-border-alert-primary palette-red-600 Alert (error) primary Alert borders (e.g., borders of input fields in invalid state)
color-border-alert-on-primary palette-gray-000 Alert on primary Border color on alert primary backgrounds

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the alert primary colors
    "--sjs2-color-bg-alert-primary": "#DD0000",
    "--sjs2-color-fg-alert-primary": "#B20000",
    "--sjs2-color-border-alert-primary": "#990000"
  }
});

Static (Contextual)

Static tokens define fixed foreground and background contrast pairs. Unlike semantic backgrounds and foregrounds, these tokens are intended for contexts where predictable contrast is required regardless of the active theme. Static colors remain unchanged across light and dark themes variations.

Static Backgrounds

Static backgrounds define fixed foreground/background contrast pairs.

Variable Derived from Role
color-bg-static-1-primary palette-gray-900 Dark/static primary background
color-bg-static-1-secondary palette-gray-900, opacity-x010 Dark/static secondary background
color-bg-static-1-primary-dim palette-gray-700 Dimmed dark/static primary background
color-bg-static-1-secondary-dim palette-gray-900, opacity-x015 Dimmed dark/static secondary background
color-bg-static-2-primary palette-gray-000 Light/static primary background
color-bg-static-2-secondary palette-gray-000, opacity-x010 Light/static secondary background
color-bg-static-2-primary-dim palette-gray-100 (+10% L) Dimmed light/static primary background
color-bg-static-2-secondary-dim palette-gray-000, opacity-x015 Dimmed light/static secondary background

Static Foregrounds

Static foreground tokens provide fixed contrast colors intended for contextual surfaces.

Variable Derived from Role
color-fg-static-1-primary palette-gray-000 Foreground on dark/static backgrounds
color-fg-static-2-primary palette-gray-900 Foreground on light/static backgrounds

Static Borders

Static border tokens define fixed border colors intended for contextual surfaces.

Variable Derived from Role Affects
color-border-static-1-primary palette-gray-000 Static 1 (light) Static borders, do not change between light and dark theme variations
color-border-static-2-primary palette-gray-900 Static 2 (dark) Static borders, do not change between light and dark theme variations

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the static colors
    "--sjs2-color-bg-static-1-primary": "#FFFFFF",
    "--sjs2-color-bg-static-2-primary": "#000000".
    "--sjs2-color-fg-static-1-primary": "#E4EBF2",
    "--sjs2-color-fg-static-2-primary": "#1D252D",
    "--sjs2-color-border-static-1-primary": "#D5DCE3",
    "--sjs2-color-border-static-2-primary": "#1D252D"
  }
});

Utility

Utility tokens define application-level shadows, overlays, and layout surfaces used across SurveyJS containers.

Shadows

Variable Derived from Role
color-utility-shadow-floating-default #004C44, opacity-x015 Subtle shadow tint for floating surfaces
color-utility-shadow-surface-default palette-gray-999, opacity-x010 Default surface shadow for resting state containers
color-utility-shadow-surface-disabled palette-gray-999, opacity-x010 Disabled surface shadow (muted depth indication)
color-utility-shadow-surface-dragging #004C44, opacity-x015 Shadow for dragged surfaces indicating lift and motion
color-utility-shadow-surface-focused color-project-brand-600 Focus accent shadow for active surface emphasis
color-utility-shadow-surface-hovered color-project-brand-600, opacity-x040 Hover highlight shadow for interactive surfaces
color-utility-shadow-surface-pressed color-project-brand-600 Pressed state shadow reinforcing interaction feedback
color-utility-shadow-trigger-default color-border-basic-secondary Default shadow/border tint for interactive controls
color-utility-shadow-trigger-design color-border-basic-secondary Design-time trigger emphasis (same base as default)
color-utility-shadow-trigger-disabled color-border-basic-secondary-disabled Disabled trigger visual state
color-utility-shadow-trigger-hovered color-border-basic-secondary Hover state emphasis for triggers
color-utility-shadow-trigger-invalid color-border-alert-primary Error state emphasis for invalid controls
color-utility-shadow-trigger-pressed color-border-basic-secondary Pressed state emphasis for triggers
color-utility-shadow-trigger-readonly color-border-basic-primary Read-only state emphasis for non-editable controls

Backgrounds

Variable Derived from Role
color-utility-body palette-gray-000 Page background layer
color-utility-sheet palette-gray-000 Background color of elevated overlay surfaces (modals, bottom sheets, dropdowns)
color-utility-overlay palette-gray-000 Backdrop color behind modals and bottom sheets
color-utility-surface-survey #1c1b200d Survey background color
color-utility-surface-survey-panelless palette-gray-000 Survey background color in panelless layout

Example:

survey.applyTheme({
  "cssVariables": {
    // Override a utility background color
    "--sjs2-color-utility-surface-survey": "#E4EBF2",
    "--sjs2-color-utility-surface-survey-panelless": "#FFFFFF"
  }
});

Radius

Radius tokens define corner shapes used across SurveyJS components. These tokens help maintain consistent component geometry.

Variable Derived from Role Affects
radius-form radius-x100 Corner radius for all form components Input fields, buttons, actions
radius-form-item radius-x050 Corner radius for elements inside parent form components Small elements inside input fields, buttons, and actions (e.g., swatch color preview, tag box or button group item, question box action)

Example:

survey.applyTheme({
  "cssVariables": {
    // Increase corner roundness
    "--sjs2-radius-form": "12px",
    "--sjs2-radius-form-item": "8px"
  }
});

Opacity

Opacity tokens control transparency levels used for visibility states, interaction feedback, overlays, and disabled elements. These tokens help create consistent visual emphasis and interaction behavior across components.

Variable Derived from Role Affects
opacity-visible opacity-x100 Default Fully visible UI elements, active content, standard rendering
opacity-hovered opacity-x100 Hover Hovered interactive elements and hover-state overlays
opacity-pressed opacity-x100 Active Pressed controls and interaction feedback states
opacity-disabled opacity-x025 Disabled Disabled controls, inactive content, unavailable actions
opacity-hidden opacity-x000 Hidden Fully transparent or visually hidden elements

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the opacity for disabled elements
    "--sjs2-opacity-disabled": "var(--sjs2-opacity-x050)"
  }
});

Border Effects

Border effect tokens define shadow- and outline-based visual treatments applied around component edges. They control visual elevation, focus indication, interaction feedback, and surface emphasis across different component states.

Border effect values follow the box-shadow CSS property value structure:

offset-x offset-y blur spread color

For example:

"--sjs2-border-effect-floating-default": "0px 6px 20px 0px #000000"

Border Effect Primitives

Border effect tokens are built from lower-level primitives that define shadow geometry and positioning. These primitives feed semantic --sjs2-border-effect-* tokens for surfaces, triggers, floating layers, and component states. Updating primitives propagates changes across all dependent effects.

Floating layers
Effect Variable Derived from / Value Role
Spread border-spread-floating-default 0px Default
Blur border-blur-floating-default 20px Default
Horizontal Offset border-offset-x-floating-default 0px Default
Vertical Offset border-offset-y-floating-default 6px Default
Surfaces
Effect Variable Derived from / Value Role
Spread border-spread-surface-default border-width-x100 Default
Spread border-spread-surface-hovered border-width-x200 Hovered
Spread border-spread-surface-pressed border-width-x200 Pressed
Spread border-spread-surface-focused border-width-x200 Focused
Spread border-spread-surface-disabled border-width-x100 Disabled
Spread border-spread-surface-dragging 4px Dragging
Blur border-blur-surface-default 0px Default
Blur border-blur-surface-hovered 0px Hovered
Blur border-blur-surface-pressed 0px Pressed
Blur border-blur-surface-focused 0px Focused
Blur border-blur-surface-disabled 0px Disabled
Blur border-blur-surface-dragging 12px Dragging
Horizontal Offset border-offset-x-surface-default 0px Default
Horizontal Offset border-offset-x-surface-hovered 0px Hovered
Horizontal Offset border-offset-x-surface-pressed 0px Pressed
Horizontal Offset border-offset-x-surface-focused 0px Focused
Horizontal Offset border-offset-x-surface-disabled 0px Disabled
Horizontal Offset border-offset-x-surface-dragging 0px Dragging
Vertical Offset border-offset-y-surface-default 0px Default
Vertical Offset border-offset-y-surface-hovered 0px Hovered
Vertical Offset border-offset-y-surface-pressed 0px Pressed
Vertical Offset border-offset-y-surface-focused 0px Focused
Vertical Offset border-offset-y-surface-disabled 0px Disabled
Vertical Offset border-offset-y-surface-dragging 6px Dragging
Triggers
Effect Variable Derived from / Value Role
Spread border-spread-trigger-default border-width-x100 Default
Spread border-spread-trigger-hovered border-width-x100 Hovered
Spread border-spread-trigger-pressed border-width-x100 Pressed
Spread border-spread-trigger-disabled border-width-x100 Disabled
Spread border-spread-trigger-design border-width-x100 Design
Spread border-spread-trigger-readonly border-width-x100 Read-only
Spread border-spread-trigger-invalid border-width-x100 Invalid
Blur border-blur-trigger-default 0px Default
Blur border-blur-trigger-hovered 0px Hovered
Blur border-blur-trigger-pressed 0px Pressed
Blur border-blur-trigger-disabled 0px Disabled
Blur border-blur-trigger-design 0px Design
Blur border-blur-trigger-readonly 0px Read-only
Blur border-blur-trigger-invalid 0px Invalid
Horizontal Offset border-offset-x-trigger-default 0px Default
Horizontal Offset border-offset-x-trigger-hovered 0px Hovered
Horizontal Offset border-offset-x-trigger-pressed 0px Pressed
Horizontal Offset border-offset-x-trigger-disabled 0px Disabled
Horizontal Offset border-offset-x-trigger-design 0px Design
Horizontal Offset border-offset-x-trigger-readonly 0px Read-only
Horizontal Offset border-offset-x-trigger-invalid 0px Invalid
Vertical Offset border-offset-y-trigger-default 0px Default
Vertical Offset border-offset-y-trigger-hovered 0px Hovered
Vertical Offset border-offset-y-trigger-pressed 0px Pressed
Vertical Offset border-offset-y-trigger-disabled 0px Disabled
Vertical Offset border-offset-y-trigger-design 0px Design
Vertical Offset border-offset-y-trigger-readonly 0px Read-only
Vertical Offset border-offset-y-trigger-invalid 0px Invalid
Form components
Effect Variable Derived from / Value Role
Spread border-spread-form-default border-width-x100 Default
Spread border-spread-form-hovered border-width-x100 Hovered
Spread border-spread-form-pressed border-width-x100 Pressed
Spread border-spread-form-focused border-width-x200 Focused
Spread border-spread-form-highlighted border-width-x200 Highlighted
Spread border-spread-form-disabled border-width-x100 Disabled
Spread border-spread-form-invalid border-width-x100 Invalid
Spread border-spread-form-invalid-focused border-width-x200 Invalid Focused
Spread border-spread-form-readonly border-width-x100 Read-only
Spread border-spread-form-design border-width-x100 Design
Blur border-blur-form-default 0px Default
Blur border-blur-form-hovered 0px Hovered
Blur border-blur-form-pressed 0px Pressed
Blur border-blur-form-focused 0px Focused
Blur border-blur-form-highlighted 0px Highlighted
Blur border-blur-form-disabled 0px Disabled
Blur border-blur-form-invalid 0px Invalid
Blur border-blur-form-invalid-focused 0px Invalid Focused
Blur border-blur-form-readonly 0px Read-only
Blur border-blur-form-design 0px Design
Horizontal Offset border-offset-x-form-default 0px Default
Horizontal Offset border-offset-x-form-hovered 0px Hovered
Horizontal Offset border-offset-x-form-pressed 0px Pressed
Horizontal Offset border-offset-x-form-focused 0px Focused
Horizontal Offset border-offset-x-form-highlighted 0px Highlighted
Horizontal Offset border-offset-x-form-disabled 0px Disabled
Horizontal Offset border-offset-x-form-invalid 0px Invalid
Horizontal Offset border-offset-x-form-invalid-focused 0px Invalid Focused
Horizontal Offset border-offset-x-form-readonly 0px Read-only
Horizontal Offset border-offset-x-form-design 0px Design
Vertical Offset border-offset-y-form-default 0px Default
Vertical Offset border-offset-y-form-hovered 0px Hovered
Vertical Offset border-offset-y-form-pressed 0px Pressed
Vertical Offset border-offset-y-form-focused 0px Focused
Vertical Offset border-offset-y-form-highlighted 0px Highlighted
Vertical Offset border-offset-y-form-disabled 0px Disabled
Vertical Offset border-offset-y-form-invalid 0px Invalid
Vertical Offset border-offset-y-form-invalid-focused 0px Invalid Focused
Vertical Offset border-offset-y-form-readonly 0px Read-only
Vertical Offset border-offset-y-form-design 0px Design

Floating Layers

Floating border effects define elevation styling for transient UI layers that sit above the main surface (overlays, popovers, dropdowns).

Variable Value Role
border-effect-floating-default Default floating primitives + color-utility-shadow-floating-default Default elevation effect for floating surfaces

Example:

survey.applyTheme({
  "cssVariables": {
    // Increase floating surface elevation
    "--sjs2-border-effect-floating-default": "0px 10px 32px 0px rgba(0, 0, 0, 0.18)"
  }
});

Surfaces

Surface border effects define state-driven styling for container-level components.

Variable Value Role
border-effect-surface-default Default surface primitives + color-utility-shadow-surface-default Default surface outline/elevation for static containers
border-effect-surface-disabled Disabled surface primitives + color-utility-shadow-surface-disabled Disabled surface state styling for containers
border-effect-surface-dragging Dragging surface primitives + color-utility-shadow-surface-dragging Elevated effect indicating drag interaction
border-effect-surface-focused Focused surface primitives + color-utility-shadow-surface-focused Focus indication for surface-level components
border-effect-surface-hovered Hovered surface primitives + color-utility-shadow-surface-hovered Hover feedback for surface-level components
border-effect-surface-pressed Pressed surface primitives + color-utility-shadow-surface-pressed Pressed interaction feedback for surfaces

Example:

survey.applyTheme({
  "cssVariables": {
    // Increase surface outline emphasis
    "--sjs2-border-effect-surface-default": "0px 0px 0px 2px rgba(8, 93, 229, 0.14)"
  }
});

Triggers

Trigger border effects define states for small interactive UI controls such as actions and buttons.

Variable Value Role
border-effect-trigger-default Default trigger primitives + color-utility-shadow-trigger-default Default state for interactive controls
border-effect-trigger-design Design trigger primitives + color-utility-shadow-trigger-design Design-time emphasis state for interactive controls
border-effect-trigger-disabled Disabled trigger primitives + color-utility-shadow-trigger-disabled Disabled state styling for interactive controls
border-effect-trigger-hovered Hovered trigger primitives + color-utility-shadow-trigger-hovered Hover feedback for interactive controls
border-effect-trigger-invalid Invalid trigger primitives + color-utility-shadow-trigger-invalid Validation error state for interactive controls
border-effect-trigger-pressed Pressed trigger primitives + color-utility-shadow-trigger-pressed Pressed interaction state for interactive controls
border-effect-trigger-readonly Read-only trigger primitives + color-utility-shadow-trigger-readonly Read-only state styling for UI controls

Example:

survey.applyTheme({
  "cssVariables": {
    // Customize trigger outline styling
    "--sjs2-border-effect-trigger-default": "0px 0px 0px 1px rgba(0, 21, 54, 0.24)"
  }
});

Form Elements

Form element border effects control the appearance of individual controls, such as input fields, checkboxes, radio buttons, and toggles. Unlike floating layers, surfaces, and triggers, form elements do not have dedicated semantic border effect tokens. Instead, their border effects are derived from border effect primitives, which allow you to customize all form elements consistently.

Example:

survey.applyTheme({
  "cssVariables": {
    // Increase the blur radius of focused form element border effects
    "--sjs2-border-blur-form-focused": "2px"
  }
});

Typography

Typography tokens define the text system used throughout the SurveyJS UI. They control font families, font weights, text sizing, and vertical rhythm to ensure consistent readability and visual hierarchy.

Font Families

These tokens define the primary typefaces across the interface.

Variable Derived from Role Affects
typography-font-family-text "Open Sans" UI text Default UI text
typography-font-family-code "DM Mono" Code Embedded code examples

Font Weights

These tokens define the font weights used across the interface.

Variable Derived from Role Affects
typography-font-weight-basic font-weight-regular Default Default font weight for any text (input content, labels, descriptions, etc.)
typography-font-weight-strong font-weight-semibold Emphasis Titles (headings & subheadings), text in selected state

Font Sizes

Typography size tokens define the text scale used throughout the UI.

Variable Derived from Role Affects
typography-font-size-small font-size-x150 Small Footnote text
typography-font-size-default font-size-x200 Default Body text
typography-font-size-medium font-size-x300 Medium Subheading text
typography-font-size-large font-size-x400 Large Heading text

Line Heights

Line height tokens define vertical spacing between lines of text.

Variable Derived from Role Affects
typography-line-height-small line-height-x200 Small Footnote text
typography-line-height-default line-height-x300 Default Body text
typography-line-height-medium line-height-x400 Medium Subheading text
typography-line-height-large line-height-x500 Large Heading text

Example:

survey.applyTheme({
  "cssVariables": {
    // Change the font family and increase the default font size and line height
    "--sjs2-typography-font-family-text": "Inter",
    "--sjs2-typography-font-size-default": "var(--sjs2-font-size-x250)",
    "--sjs2-typography-line-height-default": "var(--sjs2-line-height-x400)"
  }
});

Survey Creator Tokens

Survey Creator tokens customize the appearance of Survey Creator elements. These tokens primarily control workspace surfaces and editor backgrounds.

Surfaces

Variable Derived from Role
color-utility-surface-designer #edf9f7 Background color in the Designer tab
color-utility-surface-logic color-utility-surface-designer Background color in the Logic tab
color-utility-surface-json-editor color-utility-surface-designer Background color in the JSON Editor tab
color-utility-surface-translations color-utility-surface-designer Background color in the Translations tab
color-utility-surface-embed color-utility-surface-designer Background color in the Embed Survey tab
color-utility-surface-presets-manager #1c1b200d Background color in the UI Preset Editor

Example:

creator.applyTheme({
  "cssVariables": {
    // Customize Survey Creator workspace surfaces
    "--sjs2-color-utility-surface-designer": "#edf9f7",
    "--sjs2-color-utility-surface-logic": "#f5fbfa",
    "--sjs2-color-utility-surface-json-editor": "#f7fafc"
  }
});

Dashboard Tokens

Dashboard tokens customize the appearance of SurveyJS Dashboard elements, including tables, charts, analytics views, and data visualizations.

Surface

Variable Derived from Role
color-utility-surface-dashboard color-utility-surface-survey Background surface for dashboard views

Chart Colors (Axis & Grid)

These tokens define the colors used for the chart grid.

Variable Derived from Role
color-data-grid-fg-label color-fg-basic-primary Color for labels on the chart axis
color-data-grid-border-axis color-border-basic-primary Color for the chart axis
color-data-grid-border-line color-border-basic-secondary Color for grid lines

Chart Colors (Background)

These tokens define the default palette used in charts.

Variable Value
color-data-chart-bg-color-1 #84CAD4
color-data-chart-bg-color-2 #3A99FB
color-data-chart-bg-color-3 #FF6771
color-data-chart-bg-color-4 #1DB496
color-data-chart-bg-color-5 #FFC152
color-data-chart-bg-color-6 #ABA1FF
color-data-chart-bg-color-7 #7D8CA5
color-data-chart-bg-color-8 #4FC46C
color-data-chart-bg-color-9 #E87BCB
color-data-chart-bg-color-10 #4E6198

Chart Colors (Borders)

Border colors default to their matching chart background colors.

Variable Value
color-data-chart-border-color-1 color-data-chart-bg-color-1
color-data-chart-border-color-2 color-data-chart-bg-color-2
color-data-chart-border-color-3 color-data-chart-bg-color-3
color-data-chart-border-color-4 color-data-chart-bg-color-4
color-data-chart-border-color-5 color-data-chart-bg-color-5
color-data-chart-border-color-6 color-data-chart-bg-color-6
color-data-chart-border-color-7 color-data-chart-bg-color-7
color-data-chart-border-color-8 color-data-chart-bg-color-8
color-data-chart-border-color-9 color-data-chart-bg-color-9
color-data-chart-border-color-10 color-data-chart-bg-color-10

Chart Colors (Foreground)

Foreground tokens define text and icon colors displayed on chart-colored surfaces.

Variable Value
color-data-chart-fg-on-color-1 palette-gray-000
color-data-chart-fg-on-color-2 palette-gray-000
color-data-chart-fg-on-color-3 palette-gray-000
color-data-chart-fg-on-color-4 palette-gray-000
color-data-chart-fg-on-color-5 palette-gray-000
color-data-chart-fg-on-color-6 palette-gray-000
color-data-chart-fg-on-color-7 palette-gray-000
color-data-chart-fg-on-color-8 palette-gray-000
color-data-chart-fg-on-color-9 palette-gray-000
color-data-chart-fg-on-color-10 palette-gray-000

Example:

dashboard.applyTheme({
  "cssVariables": {
    // Customize dashboard chart palette
    "--sjs2-color-data-chart-bg-color-1": "#4F46E5",
    "--sjs2-color-data-chart-bg-color-2": "#0EA5E9",
    "--sjs2-color-data-chart-bg-color-3": "#10B981",
    "--sjs2-color-data-chart-bg-color-4": "#F59E0B",
    "--sjs2-color-data-chart-bg-color-5": "#EF4444"
  }
});

PDF Layout Tokens

When you apply a theme to a PDF document, only color tokens are applied. Layout-related tokens such as spacing, sizing, typography, border radius, and border width are configured separately through a PDF layout object. This separation exists because printed and PDF forms often require different spacing, typography, and proportions than web-based forms.

PDF Generator includes two predefined layout presets:

  • Compact – Optimized for dense forms and reduced page count
  • Spacious – Optimized for readability

These layout presets include system tokens, typography tokens, and PDF-specific tokens with -pdf- in their names. PDF-specific tokens specify the radius, border width, paddings, and gaps between elements in a generated PDF form. For a complete list of layout tokens, refer to the layout preset definitions on GitHub:

Use the applyTheme() method to override colors, and the PDF-specific applyLayout() method to override layout and typography settings.

surveyPdf.applyTheme({
  "cssVariables": {
    // Override the primary brand color used in the PDF
    "--sjs2-color-project-brand-600": "#085DE5"
  }
});

surveyPdf.applyLayout({
  // Override the default font family
  "--sjs2-typography-font-family-text": "Noto Serif",
   // Override the border width used for questions
  "--sjs2-pdf-border-width-question": "var(--sjs2-border-width-x200)"
});

Layer 4 – Individual Component Tokens

Individual component tokens allow you to override semantic token values for specific UI components without affecting the entire design system. These tokens provide component-level customization for colors, typography, spacing, borders, and radii.

Use component tokens when a specific component requires custom styling that differs from the shared system defaults.

Component Token Naming System

Most component tokens follow this naming structure:

--sjs2-[domain]-[subdomain]-component-[component-name]-[role]-[variant]-[state]-[property]

The following token name segments were described earlier:

Components

Component segments target specific UI elements.

Component Affects
action Buttons and clickable actions
panel Question panels and grouped containers
question Question titles and descriptions
formbox Input fields
input Text in editable fields
check Checkboxes
toggle ON/OFF toggles (switches)
boolean Yes/No (Boolean) questions
boolean-item Yes/No (Boolean) question items
buttongroup-item Button group options
slider Slider controls
tagbox-item Tags in multi-select dropdowns
message Validation messages
header Survey header
page Survey pages

States

States define interactive or contextual appearance.

State Meaning
default Normal appearance
hovered Mouse hover
pressed Active/pressed state
focused Keyboard focus
disabled Non-interactive state
readonly Read-only state
invalid Validation error state
design Design-mode appearance

Properties

Property segments specify which visual aspect is styled.

Property Affects
bg Background color
fg Text or content color
border Border color
icon Icon color
label Input label text
placeholder Input placeholder text
value Input content color
description Helper text
thumb Slider or toggle thumb
limit Character counter or limit indicator

Buttons & Actions

Buttons, actions, and interactive controls derive their appearance from the brand, alert, and neutral semantic token groups by default. To customize them, use tokens containing -component-action-.

Example:

survey.applyTheme({
  "cssVariables": {
    // Override main action button colors
    "--sjs2-color-component-action-brand-primary-default-bg": "#FEE71B",
    "--sjs2-color-component-action-brand-primary-default-icon": "#000000",
    "--sjs2-color-component-action-brand-primary-default-label": "#000000",

    // Override alert button colors
    "--sjs2-color-component-action-alert-primary-default-bg": "#FE481B",
    "--sjs2-color-component-action-alert-primary-default-icon": "#FFFBFA",
    "--sjs2-color-component-action-alert-primary-default-label": "#FFFBFA"
  }
});

Complete Token List

Question Panels

Question panels group related survey content into structured containers on a surface. To customize them, use tokens containing -component-panel-.

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the corner radius and background color of panels
    "--sjs2-radius-component-panel": "var(--sjs2-radius-x250)",
    "--sjs2-color-component-panel-default-bg": "var(--sjs2-palette-gray-100)"
  }
});

Complete Token List

Question Titles & Descriptions

Question-related tokens control question titles, descriptions, and supporting text. Use tokens containing -component-question- to customize question titles and descriptions.

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the color and font size of question titles and descriptions
    "--sjs2-color-component-question-default-title": "var(--sjs2-palette-gray-850)",
    "--sjs2-color-component-question-default-description": "var(--sjs2-palette-gray-600)",
    "--sjs2-typography-font-size-component-question-title": "var(--sjs2-font-size-x300)",
    "--sjs2-typography-font-size-component-question-description": "var(--sjs2-font-size-x150)"
  }
});

Complete Token List

Input Fields

Input field tokens control text containers, including text boxes, text areas, dropdown inputs, and button groups. Use tokens containing -component-formbox- to customize the input fields.

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the corner radius of input fields
    "--sjs2-radius-component-formbox": "var(--sjs2-radius-round)",

    // Override the background and border colors of input fields
    "--sjs2-color-component-formbox-default-bg": "var(--sjs2-color-bg-basic-primary)",
    "--sjs2-color-component-formbox-default-border": "var(--sjs2-color-border-basic-primary)"
  }
});

Complete Token List

Text in Input Fields

Input text tokens control text color, placeholder styling, and other editable input field content. They derive from basic foreground colors by default. To override them, use tokens containing -component-input-.

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the input value color in default and disabled states
    "--sjs2-color-component-input-default-value": "#2C2625",
    "--sjs2-color-component-input-disabled-value": "#D8D1D0"
  }
});

Complete Token List

Checkboxes, Radio Buttons & Toggles

Selection controls expose separate tokens for selected and unselected states.

Use tokens containing:

  • -component-check- – Checkboxes and radio buttons
  • -component-toggle- – ON/OFF toggles (switches)
  • -component-boolean- / -component-boolean-item- – Yes/No (Boolean) question toggles
  • -component-buttongroup-item- – Button group items

-true- or -false- in the token name indicates the control state.

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the color of the checkbox background
    "--sjs2-color-component-check-true-default-bg": "#063AC8",
    "--sjs2-color-component-check-false-default-bg": "#E4EBF2",

    // Override the color of the ON/OFF toggle background
    "--sjs2-color-component-toggle-true-default-bg": "#063AC8",
    "--sjs2-color-component-toggle-false-default-bg": "#E4EBF2",

    // Override the color of the Yes/No (Boolean) question value
    "--sjs2-color-component-boolean-item-true-default-value": "var(--sjs2-color-fg-neutral-on-primary)",
    "--sjs2-color-component-boolean-item-false-default-value": "var(--sjs2-color-fg-neutral-primary)",

    // Override the color of the button group item value
    "--sjs2-color-component-buttongroup-item-true-default-value": "var(--sjs2-color-fg-brand-on-primary)",
    "--sjs2-color-component-buttongroup-item-false-default-value": "var(--sjs2-color-fg-brand-primary)"
  }
});

Complete Token List

Sliders

Slider tokens customize track, thumb, and interaction visuals. For customization, use tokens containing -component-slider-.

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the slider thumb color
    "--sjs2-color-component-slider-default-thumb": "var(--sjs2-palette-gray-900)"
  }
});

Complete Token List

Tags in Multi-Select Dropdown

Tag box tokens customize selected item tags in multi-select dropdowns. For customization, use tokens containing -component-tagbox-item-.

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the colors of the tag background, border, and label
    "--sjs2-color-component-tagbox-item-default-bg": "var(--sjs2-color-bg-brand-primary)",
    "--sjs2-color-component-tagbox-item-default-border": "var(--sjs2-color-border-brand-primary)",
    "--sjs2-color-component-tagbox-item-default-label": "var(--sjs2-color-fg-brand-on-primary)"
  }
});

Complete Token List

Validation Messages

Validation message tokens customize error, warning, and informational messages in forms. Use tokens containing -component-message-.

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the colors of the background, icon, and text in error messages
    "--sjs2-color-component-message-error-bg": "var(--sjs2-color-bg-alert-primary)",
    "--sjs2-color-component-message-error-icon": "var(--sjs2-color-fg-alert-on-primary)",
    "--sjs2-color-component-message-error-text": "var(--sjs2-color-fg-alert-on-primary)",

    // Override the colors of the background, icon, and text in warning messages
    "--sjs2-color-component-message-warning-bg": "var(--sjs2-color-bg-warning-primary)",
    "--sjs2-color-component-message-warning-icon": "var(--sjs2-color-fg-warning-on-primary)",
    "--sjs2-color-component-message-warning-text": "var(--sjs2-color-fg-warning-on-primary)",

    // Override the colors of the background, icon, and text in info messages
    "--sjs2-color-component-message-info-bg": "var(--sjs2-color-bg-note-primary)",
    "--sjs2-color-component-message-info-icon": "var(--sjs2-color-fg-note-on-primary)",
    "--sjs2-color-component-message-info-text": "var(--sjs2-color-fg-note-on-primary)",

    // Override the corner radius of all validation messages
    "--sjs2-radius-component-message": "var(--sjs2-radius-x200)"
  }
});

Complete Token List

Survey Header & Pages

Header and page tokens customize survey titles, descriptions, and typography. Use tokens containing -component-header- or -component-page-.

Example:

survey.applyTheme({
  "cssVariables": {
    // Override the font family of the survey title and description
    "--sjs2-typography-font-family-component-header-title": "Playfair Display",
    "--sjs2-typography-font-family-component-header-description": "Inter",

    // Override the colors of page titles and descriptions
    "--sjs2-color-component-page-default-title": "var(--sjs2-color-fg-brand-primary)",
    "--sjs2-color-component-page-default-description": "var(--sjs2-color-fg-basic-primary)"
  }
});

Complete Token List

Complete Token List

Refer to the following file in GitHub to view the full list of available tokens:

base-theme.scss

Send feedback to the SurveyJS team

Need help? Visit our support page

Your cookie settings

We use cookies to make your browsing experience more convenient and personal. Some cookies are essential, while others help us analyse traffic. Your personal data and cookies may be used for ad personalization. By clicking “Accept All”, you consent to the use of all cookies as described in our Terms of Use and Privacy Statement. You can manage your preferences in “Cookie settings.”

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.