Skip to main content
The gadget-ui design system is built on CSS custom properties that define a semantic color palette, typography, shadows, and border radius. Themes are switched by changing the data-theme attribute on the root element.

Color system

All colors are defined as CSS custom properties in globals.css. The Tailwind preset maps Tailwind class names to these properties.

Accent colors

The primary brand color is electric blue (#4242fc), inspired by Gadget’s visual identity. Tailwind classes:

Surface colors

Layered backgrounds for cards, modals, and overlays. Tailwind classes:

Text colors

Semantic foreground colors for readability hierarchy. Tailwind classes:

Border colors

Tailwind classes:

Semantic colors

Status indicators for success, error, warning states. Tailwind classes:

Typography

Two font families are included: Inter for UI text and Inconsolata for code.

Font families

Tailwind classes:

Font loading

Fonts are loaded via @fontsource when you import global styles:
This ensures fonts are self-hosted and available offline.

Border radius

Rounded corners use a 6px base with three modifiers. Tailwind classes:

Shadows

Neo-skeuomorphic shadows with inset highlights and ambient shadows. Example values (dark theme):
Tailwind classes:

Theme switching

Toggle between dark and light modes by setting the data-theme attribute on the root element (or any parent container).

Default theme

Dark mode is the default. No attribute is required:

Switching themes

Set data-theme="light" to activate light mode:

React example

Manage theme state and apply to a container:
ThemeToggle.tsx

Persist theme preference

Store the theme in localStorage:
useTheme.ts
Use in your app:
App.tsx

Customizing tokens

Override CSS variables to customize the design system:
custom.css
Import your custom CSS after the gadget-ui styles:
globals.css
This lets you tweak specific tokens without forking the package.

Component variants

Many components use design tokens via class-variance-authority. For example, the Button component:
Button component (excerpt)
Variants automatically adapt to theme changes because they use CSS custom properties.

Next steps

Setup

Configure Tailwind and import global styles

Components

Browse available components and variants