[ 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.

New

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

VariableLightDarkUsed for
--ru-primary#5b4cf5#7c6fffBrand color: primary buttons, focus rings, active tabs, checkboxes.
--ru-secondary#6b6b76#a1a1aaNeutral accent used by secondary badges and spinners.
--ru-success#12a150#3dd68cSuccess states.
--ru-danger#e5484d#ff6369Errors and destructive actions.
--ru-warning#d97706#f5a524Warnings.
--ru-info#2f7cf6#52a8ffInformational states.
--ru-on-color#ffffff#ffffffText on solid colored backgrounds.

Surfaces & text

VariableLightDarkUsed for
--ru-bg#fcfcfd#09090bSuggested page background.
--ru-surface#ffffff#111113Cards, inputs, menus, dialogs.
--ru-muted#f4f4f6#1c1c1fSubtle fills: hovers, table headers, tracks.
--ru-borderrgb(19 19 22 / .1)rgb(255 255 255 / .09)Hairline borders (semi-transparent).
--ru-text#131316#f4f4f5Primary text.
--ru-text-muted#6b6b76#a1a1aaSecondary text, placeholders, icons.
--ru-overlayrgb(9 9 11 / .4)rgb(0 0 0 / .6)Backdrop behind modals and drawers.

Shape, depth & type

VariableLightDarkUsed for
--ru-radius-sm0.375remsameSmall elements: menu items, tooltips.
--ru-radius0.625remsameButtons, inputs, alerts.
--ru-radius-lg0.875remsameCards, modals.
--ru-shadow-xsring + 1px dropsameSecondary buttons, Kbd.
--ru-shadow-smsoft layeredsameCards.
--ru-shadowlayeredsameElevated cards, dropdowns.
--ru-shadow-lgdeep layeredsameModals, drawers, toasts.
--ru-font-familyinheritsameComponent font. Inherits from your page by default.
--ru-font-monoGeist Mono, …sameMonospace 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).