Skip to content

Components: Ui

UI primitives (shadcn/ui on Radix UI): buttons, dialogs, sheets, inputs, selects, tables, carousels and the rest. Restyle them through the design tokens in globals.css.

Generated from apps/theme/src/components/ui/: 27 files, 78 components. Import a component through the @/components/… path shown, so a fork can override it in src/custom/.

@/components/ui/alert

apps/theme/src/components/ui/alert.tsx server component

<Alert>

No props.

<AlertTitle>

No props.

<AlertDescription>

No props.

@/components/ui/badge

apps/theme/src/components/ui/badge.tsx server component

<Badge>

PropTypeDescription
dot?booleanLeading colour dot, Freshdesk-style. Takes tone when set, else the text colour.
tone?string | nullA hex colour to render the badge in. Implies variant="tone" — pass it instead of variant, not alongside. Ignored unless it parses as a hex colour, so the badge falls back to whatever variant says.

@/components/ui/breadcrumb

apps/theme/src/components/ui/breadcrumb.tsx client component

Required: importing Radix Slot (via the radix-ui umbrella) in a server-graph module crashes the production build ("c.createContext is not a function") once react-slot >=1.3.1 is resolved. This directive keeps Slot in the client graph, making the build immune to which react-slot version installs. Do NOT remove.

<Breadcrumb>

Props: React.ComponentProps<"nav">

<BreadcrumbList>

Props: React.ComponentProps<"ol">

<BreadcrumbItem>

Props: React.ComponentProps<"li">

<BreadcrumbPage>

Props: React.ComponentProps<"span">

<BreadcrumbSeparator>

Props: React.ComponentProps<"li">

<BreadcrumbEllipsis>

Props: React.ComponentProps<"span">

@/components/ui/button

apps/theme/src/components/ui/button.tsx client component

Required: importing Radix Slot (via the radix-ui umbrella) in a server-graph module crashes the production build ("c.createContext is not a function") once react-slot >=1.3.1 is resolved. This directive keeps Slot in the client graph, making the build immune to which react-slot version installs. Do NOT remove.

<Button>

Props: ButtonProps

@/components/ui/calendar

apps/theme/src/components/ui/calendar.tsx client component

<Calendar>

PropTypeDescription
buttonVariant?React.ComponentProps<typeof Button>["variant"]

Also accepts: React.ComponentProps<typeof DayPicker>

<CalendarDayButton>

Props: React.ComponentProps<typeof DayButton>

apps/theme/src/components/ui/carousel-strip.tsx client component

apps/theme/src/components/ui/carousel.tsx client component

@/components/ui/checkbox

apps/theme/src/components/ui/checkbox.tsx server component

<Checkbox>

No props.

<Radio>

No props.

@/components/ui/collapsible

apps/theme/src/components/ui/collapsible.tsx client component

<Collapsible>

Registry Collapsible, imported from the radix-ui umbrella like popover, label and separator — the umbrella already bundles it, so this adds no dependency and no version pin to keep in lockstep (see the write-up in components/providers/direction-provider.tsx).

Note that Collapsible UNMOUNTS its content when closed. That is why app/[locale]/account/_components/account-list.tsx does not use this: its panels are collapsed on mobile but always open on desktop, driven purely by hidden sm:block with no viewport branch in JS. Forcing that through a Collapsible would mean forceMount plus the same CSS, which is more moving parts for no gain.

Props: React.ComponentProps<typeof CollapsiblePrimitive.Root>

<CollapsibleTrigger>

Props: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>

<CollapsibleContent>

Props: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>

@/components/ui/container

apps/theme/src/components/ui/container.tsx server component

<Container>

sm/md/lg reference the breakpoint theme variables directly instead of the max-w-screen-* shorthand. This is a deprecation migration, NOT a bug fix: Tailwind v4.3 still compiles max-w-screen-lg to max-width:var(--breakpoint-lg), so the rendered width is unchanged — the shorthand is simply undocumented in v4 and superseded by this form, which is what the v4 docs now show for breakpoint-valued widths.

xl/full use arbitrary values and are unrelated. full (header, footer, listings, home sections) is 1800px — the 3xl breakpoint — so the 5-column product grid that starts there keeps ~341px cards.

PropTypeDescription
size?"sm" | "md" | "lg" | "xl" | "full"

@/components/ui/dialog

apps/theme/src/components/ui/dialog.tsx client component

<Dialog>

Props: React.ComponentProps<typeof DialogPrimitive.Root>

<DialogTrigger>

Props: React.ComponentProps<typeof DialogPrimitive.Trigger>

<DialogPortal>

Props: React.ComponentProps<typeof DialogPrimitive.Portal>

<DialogOverlay>

Props: React.ComponentProps<typeof DialogPrimitive.Overlay>

<DialogClose>

Props: React.ComponentProps<typeof DialogPrimitive.Close>

<DialogContent>

PropTypeDescription
showCloseButton?booleanRender the built-in top-end close button (default true).

Also accepts: React.ComponentProps<typeof DialogPrimitive.Content>

<DialogHeader>

Props: React.ComponentProps<"div">

<DialogTitle>

Props: React.ComponentProps<typeof DialogPrimitive.Title>

<DialogDescription>

Props: React.ComponentProps<typeof DialogPrimitive.Description>

@/components/ui/empty

apps/theme/src/components/ui/empty.tsx server component

<Empty>

Props: React.ComponentProps<"div">

<EmptyHeader>

Props: React.ComponentProps<"div">

<EmptyTitle>

Props: React.ComponentProps<"div">

<EmptyDescription>

Props: React.ComponentProps<"p">

<EmptyContent>

Props: React.ComponentProps<"div">

<EmptyMedia>

Props: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>

@/components/ui/input

apps/theme/src/components/ui/input.tsx server component

<Input>

No props.

@/components/ui/label

apps/theme/src/components/ui/label.tsx client component

<Label>

Props: React.ComponentProps<typeof LabelPrimitive.Root>

apps/theme/src/components/ui/lazy-carousel-strip.tsx client component

@/components/ui/pagination-nav

apps/theme/src/components/ui/pagination-nav.tsx server component

<PaginationNav>

Server-friendly prev / "Page N of M" / next control.

Uses the locale-aware <Link> (not a plain <a>) for two reasons: (1) a bare <a href="/search?..."> drops the /{locale} prefix, which this repo has no middleware to restore — the next path segment gets consumed as an invalid [locale] value instead; (2) <Link> client-navigates, so a page click re-renders only the changed route content instead of a full document reload.

A <Button asChild> renders a Radix Slot that merges its props onto the child <a>, but <a> has no disabled attribute — so a "disabled" link stays clickable and never gets the disabled: styling. To actually disable an edge, we render a real <button disabled> (no asChild, no href) instead of a fake-disabled link.

PropTypeDescription
currentPagenumber
totalPagesnumber
hrefForPage(page: number) => stringBuild the URL for a given (1-based) page number. Locale-relative — no /{locale} prefix — <Link> (below) adds it, matching every other internal href in this codebase (there is no locale-detection middleware, so a raw <a href="/..."> without the prefix 404s / resolves the wrong route segment).
previousLabelstring
nextLabelstring
pageLabelstringAlready-formatted "Page N of M" text.

@/components/ui/popover

apps/theme/src/components/ui/popover.tsx client component

<Popover>

Props: React.ComponentProps<typeof PopoverPrimitive.Root>

<PopoverAnchor>

Props: React.ComponentProps<typeof PopoverPrimitive.Anchor>

<PopoverContent>

Props: React.ComponentProps<typeof PopoverPrimitive.Content>

<PopoverDescription>

Props: React.ComponentProps<"p">

<PopoverHeader>

Props: React.ComponentProps<"div">

<PopoverTitle>

Props: React.ComponentProps<"h2">

<PopoverTrigger>

Props: React.ComponentProps<typeof PopoverPrimitive.Trigger>

@/components/ui/progress

apps/theme/src/components/ui/progress.tsx client component

<Progress>

Props: React.ComponentProps<typeof ProgressPrimitive.Root> & VariantProps<typeof progressVariants>

@/components/ui/select

apps/theme/src/components/ui/select.tsx server component

<Select>

Styled native <select>. Shares Input's exact visual contract (h-10, rounded-sm, border, focus-visible ring at ring-offset-2) so form controls line up. Native on purpose — keeps SSR/RTL trivial and adds no Radix dependency; it replaces the ~6 inline select class strings that had drifted (h-9 vs h-10, ring-offset-1 vs -2, focus vs focus-visible).

No props.

@/components/ui/separator

apps/theme/src/components/ui/separator.tsx client component

<Separator>

Props: React.ComponentProps<typeof SeparatorPrimitive.Root>

@/components/ui/sheet

apps/theme/src/components/ui/sheet.tsx client component

<Sheet>

Props: React.ComponentProps<typeof SheetPrimitive.Root>

<SheetTrigger>

Props: React.ComponentProps<typeof SheetPrimitive.Trigger>

<SheetClose>

Props: React.ComponentProps<typeof SheetPrimitive.Close>

<SheetPortal>

Props: React.ComponentProps<typeof SheetPrimitive.Portal>

<SheetOverlay>

Props: React.ComponentProps<typeof SheetPrimitive.Overlay>

<SheetContent>

PropTypeDescription
showClose?booleanSet false when the panel provides its own close control in its header.

Also accepts: React.ComponentProps<typeof SheetPrimitive.Content> & VariantProps<typeof sheetVariants>

<SheetHeader>

Props: React.ComponentProps<"div">

<SheetTitle>

Props: React.ComponentProps<typeof SheetPrimitive.Title>

<SheetDescription>

Props: React.ComponentProps<typeof SheetPrimitive.Description>

@/components/ui/skeleton

apps/theme/src/components/ui/skeleton.tsx server component

<Skeleton>

Props: React.ComponentProps<"div">

@/components/ui/surface

apps/theme/src/components/ui/surface.tsx server component

<Surface>

The flat "panel" idiom the codebase standardized on by copy-paste: rounded-sm border bg-surface. One source of truth for the ~32 files that inlined rounded-sm border bg-surface p-N. Padding is left to the caller (p-4, p-6, …) since it varies per panel — pass it via className. Distinct from Card (an elevated bg-background surface with a hover shadow); Surface is the muted, un-elevated grey panel.

No props.

@/components/ui/switch

apps/theme/src/components/ui/switch.tsx client component

<Switch>

Imported from the radix-ui umbrella rather than a scoped @radix-ui/react-switch dependency. The umbrella already bundles Switch, so this costs no new dependency — and, more to the point, no new version pin to keep in sync: every scoped Radix dep here (react-dialog, react-progress, react-slot, react-direction) has to be pinned to exactly what radix-ui pins, or npm installs a second copy and the two halves stop sharing a React context. That failure mode is written up in full in components/providers/direction-provider.tsx.

Measured both ways: Switch adds nothing to first-load JS either way, because its only consumer (the cookie banner) is reached through dynamic() in components/layout/cookie-consent-banner-lazy.tsx, so it lands in that lazy chunk rather than the shared shell.

Restyled from the registry, which ships a rounded-full pill: the theme's corners are square-ish throughout (see --radius in globals.css), so both the track and the knob use rounded-sm.

Props: React.ComponentProps<typeof SwitchPrimitive.Root>

@/components/ui/table

apps/theme/src/components/ui/table.tsx server component

<Table>

Props: React.ComponentProps<"table">

<TableHeader>

Props: React.ComponentProps<"thead">

<TableBody>

Props: React.ComponentProps<"tbody">

<TableFooter>

Props: React.ComponentProps<"tfoot">

<TableHead>

Props: React.ComponentProps<"th">

<TableRow>

Props: React.ComponentProps<"tr">

<TableCell>

Props: React.ComponentProps<"td">

<TableCaption>

Props: React.ComponentProps<"caption">

@/components/ui/textarea

apps/theme/src/components/ui/textarea.tsx server component

<Textarea>

No props.

@/components/ui/when-near-viewport

apps/theme/src/components/ui/when-near-viewport.tsx client component

<WhenNearViewport>

Renders fallback until the wrapper scrolls within rootMargin of the viewport, then renders children permanently.

The repo's first IntersectionObserver. Its purpose is to gate a fetch, not a render: delaying the render of content the server already serialized into the flight payload saves nothing, because those bytes were paid for at stream time. Only wrap content that does its own work on mount — see product-linked-grids.tsx, which uses this so the linked-product query never runs for the majority of PDP visitors who never scroll that far.

Because the gate is what decides whether the content is ever fetched, nothing SEO-relevant may go behind it: a non-rendering crawler sees fallback and nothing else, permanently. Reviews, aggregateRating and the Product JSON-LD deliberately stay server-streamed for exactly this reason.

Gate shape follows analytics/deferred-google-tag-manager.tsx: a fire-once flag, a single arm(), and full teardown from the effect's cleanup.

rootMargin defaults to 800px so the work starts well before the section is visible — the shopper should arrive at rendered content, not watch it appear.

PropTypeDescription
childrenReactNode
fallback?ReactNode
rootMargin?string