Development Under active development - Components may change before the first stable release. Join Discord
Customise

Theming

Customise naUI with CSS custom properties - no Sass, no build step.

How theming works

Every naUI value is a CSS custom property defined in :root inside naui.css. Override any token in your own stylesheet — or use a [data-theme] block — and every component that references it updates automatically. No Sass, no build step. Use the Theme picker in the header to see it live below.

Live preview

All elements below are real naUI components. Switch a theme in the header and watch them update instantly.

Buttons

Button sizes

Form controls

Please describe the issue.

Badges

Primary Secondary Success Warning Danger Info Subtle Done Error

Alerts

Theme applied — all tokens updated automatically across every component.
Settings saved successfully.
Your trial expires in 3 days.
Payment method declined. Please update your card.

Cards

Starter

$0/mo

For personal projects

Pro Popular

$19/mo

For growing teams

Enterprise

$99/mo

Unlimited everything

Custom

/mo

Tailored to your needs

Table

IDUserPlanJoinedStatusMRR
#1001Alice MartinProJan 2025Active$19
#1002Bob ChenStarterMar 2025Active$0
#1003Carol SmithEnterpriseJun 2025Trial$99
#1004Dave LeeProAug 2025Churned$0
#1005Eve TorresEnterpriseNov 2025Active$99

Tabs

Pagination

Breadcrumb

Accordion

Any token defined in :root inside naui.css — colours, radius, shadow, spacing, typography, and component surface tokens.
/* Apply a theme block in your stylesheet, after naui.css */
[data-theme="brand"] {
  --color-primary:   #7c3aed;
  --color-secondary: #0ea5e9;
  --color-brand:     #f59e0b;

  /* Radius — pill buttons, rounded inputs */
  --na-rounded-sm:  4px;
  --na-rounded-md:  8px;
  --na-rounded-lg:  12px;
  --na-rounded-xl:  18px;
  --na-rounded-2xl: 999px;
}

/* Apply to the whole page */
html[data-theme="brand"] .na-button { border-radius: 9999px; }
html[data-theme="brand"] .na-input,
html[data-theme="brand"] .na-select  { border-radius: 10px; }

Colour token map

Base semantic colour tokens - these are the ones you override to theme naUI. Every component references these values.

TokenDefaultSwatchUsed by
--color-white#ffffffSurfaces, text on dark
--color-black#000000Text, borders
--color-disabled#d1d5dbDisabled inputs & buttons
--color-default#6b7280Default variant buttons
--color-primary#3b82f6Buttons, links, focus rings
--color-secondary#6366f1Secondary buttons
--color-success#22c55eAlerts, badges, status dots
--color-warning#f59e0bAlerts, badges
--color-danger#ef4444Alerts, invalid inputs
--color-info#0ea5e9Info alerts, chips
--color-brand#8b5cf6Brand accent elements
--color-accent#14b8a6Teal accent elements

Interaction states

Hover and active states are computed automatically from each base token using relative hsl() colour syntax. You do not need to override these unless you want manual control.

Token patternHow it is derived
--color-{name}-hoverSaturation −12, lightness −9 relative to base
--color-{name}-activeSaturation −10, lightness −16 relative to base

Subtle variants

Each semantic colour automatically gets three derived subtle tokens used for tinted surfaces, borders, and text - computed via color-mix().

Token patternFormulaUsage
--color-{name}-subtle12% tint with whiteAlert / badge backgrounds
--color-{name}-subtle-border35% tint with whiteAlert / badge borders
--color-{name}-subtle-textLightness −32 via hsl()Alert / badge text

Available for: primary, secondary, success, warning, danger, info, brand, accent.

Gray scale

Neutral grays used for surfaces, borders, and text throughout the system.

TokenDefaultSwatch
--na-gray-50#f9fafb
--na-gray-100#f3f4f6
--na-gray-200#e5e7eb
--na-gray-300#d1d5db
--na-gray-400#9ca3af
--na-gray-500#6b7280
--na-gray-600#4b5563
--na-gray-700#374151
--na-gray-800#1f2937
--na-gray-900#111827

Typography tokens

TokenDefault
--na-font-sansMontserrat, system-ui, sans-serif
--na-font-monoui-monospace, Cascadia Code, monospace
--na-font-size-xs - 3xl0.75rem – 2.25rem
--na-font-weight-400 - bold400 / 500 / 600 / 700 / 800

Spacing scale

TokenValue
--na-space-10.25rem
--na-space-20.5rem
--na-space-30.75rem
--na-space-41rem
--na-space-51.25rem
--na-space-61.5rem
--na-space-82rem
--na-space-102.5rem
--na-space-123rem
--na-space-164rem

Border radius

naUI defaults to a square (0) design with a pill-only exception.

TokenDefault value
--na-rounded0
--na-rounded-sm - 2xlall 0
--na-rounded-full9999px

Dark mode skeleton

[data-theme="dark"] {
  --color-primary:          #60a5fa;
  --na-border-color:        #374151;
  --na-gray-50:             #111827;
  --na-gray-100:            #1f2937;
  --na-gray-900:            #f9fafb;
  /* - override greys + surface tokens */
}