Colors
Visual reference for all 8 semantic colors, base surface scale, and border tokens available in every Ninna UI theme.
Interactive Theme Showcase
Experience real-time interactive color scaling across 5 built-in themes. All components below are strictly driven by CSS semantic properties.
Theme Showcase
Interactive Elements
Forms & Toggles
Enable Dark Mode
Push Notifications
Semantic Colors
Surfaces & Data
Light to dark cascading scales
Semantic Colors
8 semantic colors rigorously matched to specific UI intentions. Each semantic variant automatically ships with a mathematically calculated -content property to guarantee WCAG AA text contrast.
Primary
Main brand color. Used for primary actions, links, and key UI elements.
Secondary
Supporting brand color. Used for secondary actions and accents.
Accent
Highlight color for special elements, tags, and decorative UI.
Neutral
Muted color for subtle backgrounds, disabled states, and secondary text.
Success
Positive states - confirmations, completed actions, valid inputs.
Danger
Error and destructive states - validation errors, delete confirmations.
Warning
Caution states - non-blocking alerts, expiration notices.
Info
Informational states - tips, help text, neutral notifications.
Content colors are automatically set per theme. Use text-primary-content on bg-primary for guaranteed WCAG AA contrast.
Base Surface Scale
A minimalist, 10-step neutral topological surface scale handling everything from pure backgrounds to deeply contrasted elements. Automatically inverts precisely during dark mode toggling.
Lightest surface - page background
Card / panel backgrounds
Subtle backgrounds, code blocks
Borders, dividers
Disabled borders
Placeholder text
Secondary text
Heading text
Primary text
Darkest surface
Border Tokens
Strictly defined structural borders mapping accurately across component resting, hovering, grouping, and disabled interaction states.
Usage Patterns
Common patterns for using colors in your components.
Color usage examples
/* Semantic colors as Tailwind utilities */<Button color="primary">Primary Action</Button><Badge color="success">Active</Badge><Alert color="danger">Error occurred</Alert>
/* Background + content pairs (auto-contrast) */<div className="bg-primary text-primary-content"> White text on primary background</div>
/* Text colors for inline use */<Text className="text-base-content">Default text</Text><Text className="text-base-content/70">Secondary text (70% opacity)</Text><Text className="text-base-content/70">Muted text (40% opacity)</Text>
/* Base surface scale */<div className="bg-base-50">Page background</div><div className="bg-base-100">Card background</div><div className="bg-base-200">Subtle background</div><div className="border border-base-300">Border</div>Opacity modifiers: Use Tailwind opacity syntax liketext-base-content/70 for secondary text. This works with all semantic colors too:bg-primary/10 for subtle tinted backgrounds.
Custom Colors
Override any CSS variable to create your own theme or brand colors. All 31 variables are customizable.
Override primary color in your CSS
/* In your main CSS file - override after the theme import */@import "tailwindcss";@import "@ninna-ui/core/theme/presets/default.css";
/* Override primary to your brand color */[data-theme="default"] { --color-primary: oklch(0.52 0.28 220); /* brand blue */ --color-primary-content: oklch(0.98 0.005 220); /* white text on primary */
/* Override secondary */ --color-secondary: oklch(0.48 0.22 160); /* brand teal */ --color-secondary-content: oklch(0.98 0.005 160);
/* Override base surfaces for a warmer feel */ --color-base-50: oklch(0.985 0.005 80); --color-base-100: oklch(0.970 0.008 80); --color-base-200: oklch(0.940 0.010 80);}
/* Dark mode overrides - both selector forms required */.dark [data-theme="default"],[data-theme="default"].dark { --color-primary: oklch(0.72 0.22 220); --color-primary-content: oklch(0.12 0.02 220);}All overridable variables
--color-primaryMain brand color
--color-primary-contentText on primary bg
--color-secondarySupporting brand color
--color-secondary-contentText on secondary bg
--color-accentHighlight color
--color-accent-contentText on accent bg
--color-neutralMuted/neutral color
--color-neutral-contentText on neutral bg
--color-successPositive state color
--color-success-contentText on success bg
--color-dangerError/destructive color
--color-danger-contentText on danger bg
--color-warningCaution state color
--color-warning-contentText on warning bg
--color-infoInformational color
--color-info-contentText on info bg
--color-base-50Lightest surface
--color-base-100Card background
--color-base-200Subtle background
--color-base-300Borders, dividers
--color-base-contentDefault text color
--color-borderDefault border
--color-border-hoverHover border
--color-border-activeActive/focus border
Content colors: When you change a semantic color, also update its -content counterpart to maintain WCAG AA contrast (minimum 4.5:1 ratio for normal text).