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>
| Prop | Type | Description |
|---|---|---|
dot? | boolean | Leading colour dot, Freshdesk-style. Takes tone when set, else the text colour. |
tone? | string | null | A 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">
<BreadcrumbLink>
| Prop | Type | Description |
|---|---|---|
asChild? | boolean |
Also accepts: React.ComponentProps<"a">
<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>
| Prop | Type | Description |
|---|---|---|
buttonVariant? | React.ComponentProps<typeof Button>["variant"] |
Also accepts: React.ComponentProps<typeof DayPicker>
<CalendarDayButton>
Props: React.ComponentProps<typeof DayButton>
@/components/ui/carousel-strip
apps/theme/src/components/ui/carousel-strip.tsx client component
<CarouselStrip>
The embla half of LazyCarouselStrip. Imports embla, so never import this directly into a route — go through LazyCarouselStrip (lazy-carousel-strip.tsx), which loads it near the viewport and paints StaticCarouselStrip, the same markup without embla, until then.
Props: CarouselStripProps
@/components/ui/carousel
apps/theme/src/components/ui/carousel.tsx client component
<Carousel>
| Prop | Type | Description |
|---|---|---|
opts? | CarouselOptions | |
plugins? | CarouselPlugin | |
setApi? | (api: CarouselApi) => void |
Also accepts: React.ComponentProps<"div">
<CarouselContent>
Props: React.ComponentProps<"div">
<CarouselItem>
Props: React.ComponentProps<"div">
<CarouselPrevious>
Props: React.ComponentProps<typeof Button>
<CarouselNext>
Props: React.ComponentProps<typeof Button>
@/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.
| Prop | Type | Description |
|---|---|---|
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>
| Prop | Type | Description |
|---|---|---|
showCloseButton? | boolean | Render 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>
@/components/ui/lazy-carousel-strip
apps/theme/src/components/ui/lazy-carousel-strip.tsx client component
<LazyCarouselStrip>
A one-row slider for below-the-fold sections, on the shadcn Carousel (embla) without putting embla in the route's first-load JS.
Until the strip nears the viewport (and while the embla chunk downloads) it paints StaticCarouselStrip: the slides in the exact box embla lays them out in (overflow-hidden row, same slide widths and gutter), so the swap to the live carousel moves nothing. The slides are in the server HTML in both states, so crawlers and no-JS visitors still get every card.
Import nothing from carousel-strip.tsx here except through the lazy() below (via carousel-bundle.ts, the theme's single embla chunk): a static import would put embla back in the route chunk. Shared types and the gutter map live in carousel-strip-shared.ts for that reason.
Props: CarouselStripProps
<StaticCarouselStrip>
CarouselStrip's markup without embla: no scrolling, no arrows.
Props: CarouselStripProps
@/components/ui/pagination-nav
apps/theme/src/components/ui/pagination-nav.tsx server component
@/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>
| Prop | Type | Description |
|---|---|---|
showClose? | boolean | Set 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">
<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.
| Prop | Type | Description |
|---|---|---|
children | ReactNode | |
fallback? | ReactNode | |
rootMargin? | string |