p
GitHub

Components

Using components

pangpond-ds doesn't ship its own components. Products use shadcn's, unchanged, and the tokens make them look like the product.

Stock shadcn components with no edits. Switch the theme or mode in the header and they all follow.

New project
Give it a name. You can change it later.
Make it public
DefaultSecondaryOutlineDestructive
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
// …every component here is the file shadcn add wrote, unedited

Adding a component

Install from shadcn as usual. The props, examples and accessibility notes live in shadcn's docs. This page only covers what pangpond-ds adds.

npx shadcn@latest add button dialog input

Updating is the same command with --overwrite. Check git diff afterwards and put any product tweaks back.

Rules

  • Don't restyle colors on 1 component. No bg-* or text-* color overrides. If a product needs a different primary, set --primary in its theme, and every component changes together.
  • Don't add duration-* or ease-* to transitions. theme.css makes every bare transition use --duration-instant (150ms) and ease-out. Open and close animations (dialogs, menus) keep shadcn's own timing.
  • Edit the component file only when you must. Every edit is something you put back by hand after the next --overwrite. Write it down so it isn't lost.

Notes per component

Only components we've decided something about. Everything else: follow shadcn.

Button

  • Buttons behave like the pangpond portfolio: colors fade with the default transition, and pressing shrinks the button to --press-scale (0.97) instantly, instead of shadcn's 1px nudge. Link buttons and menu triggers don't shrink. theme.css does this, so the component file stays stock. Set --press-scale: 1 to turn the press off.
  • 1 default button per view, for the main action. Everything else is secondary, outline or ghost. destructive only for actions that lose data.
  • Labels are verbs that say what happens: "Save changes", not "OK".
  • Icon-only buttons use an icon size and need an aria-label.
  • A link that looks like a button stays a link. Use buttonVariants() on the <Link>, wrapped in cn(). Without it, the base border-transparent beats the outline border.
<Link href="/docs/installation" className={cn(buttonVariants({ variant: "outline" }))}>
  Read the docs <ArrowRight data-icon="inline-end" />
</Link>

Interaction utilities

Patterns from the pangpond portfolio that shadcn doesn't have. They ship in theme.css, so you use them as plain classes. Hover, press and tab through the examples.

<nav className="flex gap-4 text-sm">
  <a href="#" className="link-quiet">Work</a>
  <a href="#" className="link-quiet">About</a>
</nav>

<p>Built with <a href="#" className="link-prose">Base UI</a>.</p>

<a href="#" className="pressable focus-ring block rounded-xl">
  <div className="overflow-hidden rounded-xl">
    <img className="hover-zoom" src="…" alt="" />
  </div>
</a>
UtilityUse for
link-quietNav, footer and secondary links. Muted text that turns full on hover
link-proseLinks in running text. A faint underline that darkens on hover
pressableCards and large click targets. Shrinks to 0.98 while pressed
hover-zoomAn image inside a pressable or group. Zooms to 1.03 on hover. Put overflow-hidden on its wrapper
focus-ringKeyboard focus on custom interactive elements. shadcn components have their own

When to make our own

A component gets its own registry item only when 1 of these is true. Until then, note what you changed in the product.

  • A product needs a change the tokens can't make, and a 2nd product needs the same change.
  • 2 or more products need something shadcn doesn't have, like an empty state or a page header.

Why not our own copies now?

Each copy means merging every shadcn update by hand, and products lose the plain shadcn add. Stock components already follow every theme, so copies would only buy small details.