Start here
  • InstallationAdd Nelumbo to a shadcn project
  • ThemingBrand accent, neutrals, dynamic color
  • Biology componentsSequences, maps, plates and trees
  • katalyx.bio

    Theming

    Generate the theme from one brand color, pick the gray temperature, and switch light and dark.

    Nelumbo's whole color scheme comes from three settings: a brand accent, a neutral temperature and an accent vibrance. From them it builds tonal palettes in HCT (Material's hue, chroma and tone color space) and picks every role by tone, so contrast holds whatever the brand is.

    Open Customize theme in the sidebar to try settings live. The docs recolor with them.

    Generate a theme

    In a checkout of Nelumbo:

    npm run theme -- --brand green --neutral warm
    OptionValuesDefault
    --brandAn accent name (blue, cyan, green, amber, orange, red, pink, purple) or a hex colorblue
    --neutralpure, warm or coolpure
    --vibrance0.5 to 1.4, how saturated the accents are1

    It writes src/styles/nelumbo.css and the theme item of the registry. Copy the CSS into your project, or build the registry (npm run registry:build) and install @nelumbo/theme from it.

    Color roles

    Every shadcn variable is there (background, foreground, primary, secondary, muted, accent, border, input, ring, destructive, sidebar-*, chart-*), so shadcn components work unchanged. Nelumbo adds:

    • Surfaces. surface-container-lowest to surface-container-highest, five steps of gray for layers. Raised layers read lighter in dark mode, the way lit objects do.
    • Accents. Each accent has four roles: blue, blue-foreground, blue-container and blue-container-foreground, and the same for every hue, plus brand, success, warning and destructive.
    • Inverse. inverse-surface and inverse-foreground, for snackbars and tooltips.
    • Outlines. outline and outline-variant.

    See Color, depth and motion for all of them in use.

    Dynamic color

    Components are neutral by default. Set data-color="dynamic" on any element to give the components inside it the brand accent instead, and data-color="neutral" to turn it off again further down:

    <section data-color="dynamic">  <Switch />            {/* brand accent */}  <Button>Save</Button> {/* still neutral */}</section>

    katalyx.bio uses this to give the Farfa page blue and the Nera page green, the apps' own brand colors.

    Light and dark

    The theme defines both: :root is light, .dark is dark. Toggle the dark class on <html> (next-themes does this for you), and set color-scheme to match so scrollbars and form controls follow.

    Tokens

    Beyond color, the theme sets:

    • Radius. --radius and the shape scale. See Shape.
    • Elevation. shadow-e1 to shadow-e4, two-layer shadows.
    • Type roles. type-display-*, type-headline-*, type-title-*, type-body-* and type-label-* utilities. See Typography.
    • Interaction. The state-layer utility (hover, focus and press overlay) and tactile (press squeeze with a spring release).