[ Getting started ]
Theming
Re-brand the whole library with a handful of CSS variables, globally or for a single section.
Every color, radius, shadow and font in Reusify comes from a CSS custom property prefixed with --ru-. Override them in your own stylesheet to re-brand the whole library. No rebuild, no config file.
Theme playground#
Pick a brand color, radius and font. The preview updates live and the CSS you need appears next to it.
Upgrade to Pro
Unlock every feature.
Your theme
:root {
--ru-primary: #5b4cf5;
--ru-radius: 0.625rem;
--ru-font-family: 'Geist', sans-serif;
}Change the brand color#
Hover colors, focus rings, soft backgrounds and button rings are all derived from the base color with color-mix(), so one variable per color is enough.
src/index.css
:root {
--ru-primary: #0ea5e9; /* sky */
--ru-radius: 0.5rem;
--ru-font-family: 'Inter', sans-serif;
}
.dark {
--ru-primary: #38bdf8;
}Default
Sky
Rose
Green
Orange
Mono
Scoped themes#
Variables cascade, so you can theme a single section by setting them on any wrapper element. That's exactly how the swatches above are built.
<section style={{ '--ru-primary': '#e11d48', '--ru-radius': '9999px' }}>
<Button>Rounded rose button</Button>
</section>Token reference#
Colors
| Variable | Light | Dark | Used for |
|---|---|---|---|
| --ru-primary | #5b4cf5 | #7c6fff | Brand color: primary buttons, focus rings, active tabs, checkboxes. |
| --ru-secondary | #6b6b76 | #a1a1aa | Neutral accent used by secondary badges and spinners. |
| --ru-success | #12a150 | #3dd68c | Success states. |
| --ru-danger | #e5484d | #ff6369 | Errors and destructive actions. |
| --ru-warning | #d97706 | #f5a524 | Warnings. |
| --ru-info | #2f7cf6 | #52a8ff | Informational states. |
| --ru-on-color | #ffffff | #ffffff | Text on solid colored backgrounds. |
Surfaces & text
| Variable | Light | Dark | Used for |
|---|---|---|---|
| --ru-bg | #fcfcfd | #09090b | Suggested page background. |
| --ru-surface | #ffffff | #111113 | Cards, inputs, menus, dialogs. |
| --ru-muted | #f4f4f6 | #1c1c1f | Subtle fills: hovers, table headers, tracks. |
| --ru-border | rgb(19 19 22 / .1) | rgb(255 255 255 / .09) | Hairline borders (semi-transparent). |
| --ru-text | #131316 | #f4f4f5 | Primary text. |
| --ru-text-muted | #6b6b76 | #a1a1aa | Secondary text, placeholders, icons. |
| --ru-overlay | rgb(9 9 11 / .4) | rgb(0 0 0 / .6) | Backdrop behind modals and drawers. |
Shape, depth & type
| Variable | Light | Dark | Used for |
|---|---|---|---|
| --ru-radius-sm | 0.375rem | same | Small elements: menu items, tooltips. |
| --ru-radius | 0.625rem | same | Buttons, inputs, alerts. |
| --ru-radius-lg | 0.875rem | same | Cards, modals. |
| --ru-shadow-xs | ring + 1px drop | same | Secondary buttons, Kbd. |
| --ru-shadow-sm | soft layered | same | Cards. |
| --ru-shadow | layered | same | Elevated cards, dropdowns. |
| --ru-shadow-lg | deep layered | same | Modals, drawers, toasts. |
| --ru-font-family | inherit | same | Component font. Inherits from your page by default. |
| --ru-font-mono | Geist Mono, … | same | Monospace font (Kbd). |
Design language#
- Hairline, semi-transparent borders that work on any background.
- Layered shadows: a 1px ring plus soft drops, instead of one blurry shadow.
- Solid buttons have a subtle top sheen and an inner highlight for a tactile feel.
- Two-step focus rings: a colored border plus a soft 4px halo.
- Geist for UI text and Geist Mono for code and keys (set them on your page; components inherit).