Real Life Talent Tree
Components

ThemeProvider

Props and CSS variables reference for the ThemeProvider component

Wraps a <TalentTree> (or any children) and sets CSS custom properties on the container <div>, allowing color customisation without touching the component internals.

Import

import { ThemeProvider } from '@real-life-talent-tree/ui'

Props

PropTypeRequiredDescription
themePartial<Theme>NoOverride any subset of theme tokens. Unset tokens fall back to defaults.
childrenReactNodeYesContent wrapped by the provider (typically <TalentTree>).
classNamestringNoCSS class applied to the wrapper <div>.
styleCSSPropertiesNoInline styles merged onto the wrapper.

CSS custom properties

All tokens are set on the wrapper <div> as CSS custom properties. You can also set them directly in CSS on any ancestor element.

CSS VariableDefaultDescription
--tt-level-1#9d9d9dLevel 1 accent — gray (Aware)
--tt-level-2#1eff00Level 2 accent — green (Familiar)
--tt-level-3#0070ddLevel 3 accent — blue (Proficient)
--tt-level-4#a335eeLevel 4 accent — purple (Advanced)
--tt-level-5#ff8000Level 5 accent — orange (Expert)
--tt-node-bgtransparentTalent node tile background
--tt-node-radius8pxTalent node border radius
--tt-pip-empty#555a6eEmpty pip border color
--tt-text-primary#5c3317Path titles and talent names
--tt-text-secondary#3a2010Popup body text
--tt-popup-bg#fdf6ecPopup background
--tt-overlay-bgrgba(26,31,46,.6)Mobile overlay backdrop

Example

import { TalentTree, ThemeProvider } from '@real-life-talent-tree/ui'
import '@real-life-talent-tree/ui/styles.css'

export default function DarkTree({ tree }) {
  return (
    <ThemeProvider
      theme={{
        nodeBg: '#1a1a2e',
        textPrimary: '#e0e0e0',
        textSecondary: '#b0b0b0',
        popupBg: '#16213e',
        overlayBg: 'rgba(0,0,0,0.7)',
      }}
    >
      <TalentTree tree={tree} />
    </ThemeProvider>
  )
}

On this page