Skip to content

Toaster theming

Every cosmetic value Toaster renders is a --rozie-toast-* custom property with a built-in fallback, so the component works with zero configuration and stays fully re-skinnable. The structural rules compile per-leaf and are not consumer-overridable — only the values below flow through tokens.

css
.rozie-toaster {
  --rozie-toast-z: 9999;
  --rozie-toast-content-gap: 0.75rem;
  --rozie-toast-success-bg: #16a34a;
  --rozie-toast-font-size: 0.9rem;
}

Tokens

region layout

TokenDefault
--rozie-toast-z9999
--rozie-toast-gap0.5rem
--rozie-toast-region-padding1rem
--rozie-toast-max-widthcalc(100vw - 2rem)
--rozie-toast-fontinherit

per-toast box model

TokenDefault
--rozie-toast-content-gap0.75rem
--rozie-toast-min-width16rem
--rozie-toast-toast-max-width24rem
--rozie-toast-padding0.75rem 1rem
--rozie-toast-color#fff
--rozie-toast-bg#333
--rozie-toast-radius0.5rem
--rozie-toast-shadow0 6px 20px rgba(0, 0, 0, 0.25)

per-type accents

TokenDefault
--rozie-toast-success-bg#16a34a
--rozie-toast-error-bg#dc2626
--rozie-toast-warning-bg#ca8a04
--rozie-toast-info-bgvar(--rozie-toast-bg, #333)

message + close button

TokenDefault
--rozie-toast-font-size0.9rem
--rozie-toast-close-size1.25rem
--rozie-toast-close-opacity0.75

enter/exit lifecycle

TokenDefault
--rozie-toast-enter-duration200ms
--rozie-toast-exit-duration200ms

stacked mode (opt-in stacked prop) — collapsed depth transform

TokenDefault
--rozie-toast-stack-offset8px
--rozie-toast-stack-scale-step0.05
--rozie-toast-depth0
--rozie-toast-swipe-exit1

the decorative 'loading' type spinner

TokenDefault
--rozie-toast-spinner-size1em
--rozie-toast-spinner-colorcurrentColor

Design-system bridges

Each package ships token presets that map Toaster's tokens onto a known design system's published CSS variables — import base.css first, then a bridge:

ts
import '@rozie-ui/toast-react/themes/base.css';
import '@rozie-ui/toast-react/themes/bootstrap.css';
import '@rozie-ui/toast-react/themes/material.css';
import '@rozie-ui/toast-react/themes/shadcn.css';

See also

Pre-1.0 — APIs may change between minor versions.