DDBS UI
commerce

Store Theme

StoreThemeProvider supplies the class prefix and link component the store components use. Colours come from --store-* CSS variables.

npx shadcn@latest add https://ui.develop-better-solutions.com/r/store-theme.json
Fullscreen

Light variables

Dark variables

Usage

store-theme-example.tsx
"use client";

import { Breadcrumbs, Stars, StoreThemeProvider } from "@dbs/ui";
import { StoreScope } from "./_store";

// A store wraps its tree once. Colours come from --store-* CSS variables on the
// store root; the prefix names the host's animation classes (.<prefix>-pop-in).
export default function StoreThemeExample() {
  return (
    <div className="grid w-full gap-4 md:grid-cols-2">
      {[false, true].map((dark) => (
        <StoreScope key={String(dark)} dark={dark} minHeight={160}>
          <StoreThemeProvider prefix="store">
            <div className="flex flex-col gap-3 text-sm">
              <Breadcrumbs
                items={[
                  { label: "Home", href: "#" },
                  { label: "Bags", href: "#" },
                  { label: "Atlas Canvas Tote" },
                ]}
              />
              <Stars rating={4.4} />
              <p className="text-[var(--store-muted)]">{dark ? "Dark variables" : "Light variables"}</p>
            </div>
          </StoreThemeProvider>
        </StoreScope>
      ))}
    </div>
  );
}