UI Components

Shared atomic components for the playground. Full interactive docs with live examples:

Storybook


Available Components

ComponentDescription
ButtonActions, links, form submits
InputText input with label and helper text
SelectDropdown selection
SliderRange input with label and unit display
SwitchToggle switch
CardContent container
BadgeSmall label/tag
LabelForm label
ColorPaletteColor swatch display
SidebarCollapsible sidebar with panel/main areas

Variants

Most components support these variants:

VariantUsage
primaryMain action (default)
secondaryAlternative action
accentHighlight, emphasis
destructiveDelete, reset, danger
outlineSecondary with border
ghostMinimal, no background

Sizes

SizeUsage
small / smCompact UI
medium / mdDefault
large / lgEmphasis
iconSquare, icon-only

Patterns

Button

import { Button } from "@repo/ui";

<Button variant="primary" size="medium">
  Click me
</Button>

<Button variant="destructive" isLoading={false}>
  Delete
</Button>

Input with Label

import { Input } from "@repo/ui";

<Input
  label="Email"
  type="email"
  placeholder="you@example.com"
  helperText="We'll never share your email"
/>;

Slider

import { Slider } from "@repo/ui";

<Slider label="Volume" value={50} min={0} max={100} unit="%" onChange={(v) => console.log(v)} />;
import { Sidebar } from "@repo/ui";

<Sidebar variant="normal" desktopPosition="left">
  <Sidebar.Toggle />
  <Sidebar.Panel>
    <p>Controls</p>
  </Sidebar.Panel>
  <Sidebar.Main>
    <p>Content</p>
  </Sidebar.Main>
</Sidebar>;

Components live in packages/ui/src/components/.