White Pill and Ghost Buttons
Primary: white fill, black 14px/500 label, 8px radius. Secondary: #1a1a1a/#1f1f1f fill with white label, same radius, used as section-header actions ('Start with agents', 'See sites', 'Read stories'). Tiny inset hairline and soft drop shadow.
Rebuilt from framer.com in the Obsidian Canvas style.
Looks exactly like framer.com: brings its fonts and colours, namespaced so your own theme stays untouched.
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
Usage
Props: headline (use \n for line break), primaryLabel, secondaryLabel, onPrimaryClick, onSecondaryClick. Renders a header row with a white primary and a dark ghost secondary button, both with 300ms hover and press scale.
components/pill-button-set.tsx
import { useState } from "react"; type Props = { headline?: string; primaryLabel?: string; secondaryLabel?: string; onPrimaryClick?: () => void; onSecondaryClick?: () => void; }; export default function WhitePillAndGhostButtons({ headline = "Design your storefront\nalongside helpers", primaryLabel = "Get started", secondaryLabel = "Meet the helpers", onPrimaryClick, onSecondaryClick, }: Props) { const [pressed, setPressed] = useState<string | null>(null); const base = "inline-flex items-center justify-center rounded-md px-3.5 h-9 text-ui font-medium whitespace-nowrap transition-[background-color,box-shadow,transform] duration-300 ease-out outline-none focus-visible:ring-2 focus-visible:ring-accent-blue focus-visible:ring-offset-2 focus-visible:ring-offset-canvas active:scale-[0.97] motion-reduce:transition-none motion-reduce:active:scale-100"; return ( <section className="bg-canvas text-primary w-full"> <div className="mx-auto flex max-w-6xl flex-col gap-6 px-6 py-10 md:flex-row md:items-end md:justify-between"> <h2 className="font-display text-h2 whitespace-pre-line tracking-[-0.02em] text-primary"> {headline} </h2> <div className="flex items-center gap-3"> <button type="button" onClick={onPrimaryClick} onMouseDown={() => setPressed("p")} onMouseUp={() => setPressed(null)} className={`${base} bg-inverse-surface text-canvas shadow-[0_1px_2px_rgba(0,0,0,0.4),inset_0_0_0_1px_rgba(255,255,255,0.6)] hover:bg-[#e6e6e6] hover:shadow-[0_4px_14px_rgba(255,255,255,0.15),inset_0_0_0_1px_rgba(255,255,255,0.8)]`} data-pressed={pressed === "p"} > {primaryLabel} </button> <button type="button" onClick={onSecondaryClick} onMouseDown={() => setPressed("s")} onMouseUp={() => setPressed(null)} className={`${base} bg-[#1a1a1a] text-primary shadow-[0_1px_2px_rgba(0,0,0,0.5),inset_0_0_0_1px_rgba(255,255,255,0.06)] hover:bg-[#262626] hover:shadow-[0_4px_14px_rgba(0,0,0,0.6),inset_0_0_0_1px_rgba(255,255,255,0.12)]`} data-pressed={pressed === "s"} > {secondaryLabel} </button> </div> </div> </section> ); }import { useState } from "react"; type Props = { headline?: string; primaryLabel?: string; secondaryLabel?: string; onPrimaryClick?: () => void; onSecondaryClick?: () => void; }; export default function WhitePillAndGhostButtons({ headline = "Design your storefront\nalongside helpers", primaryLabel = "Get started", secondaryLabel = "Meet the helpers", onPrimaryClick, onSecondaryClick, }: Props) { const [pressed, setPressed] = useState<string | null>(null); const base = "inline-flex items-center justify-center rounded-md px-3.5 h-9 text-obsidian-ui font-medium whitespace-nowrap transition-[background-color,box-shadow,transform] duration-300 ease-out outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background active:scale-[0.97] motion-reduce:transition-none motion-reduce:active:scale-100"; return ( <section className="bg-background text-foreground w-full"> <div className="mx-auto flex max-w-6xl flex-col gap-6 px-6 py-10 md:flex-row md:items-end md:justify-between"> <h2 className="font-sans text-obsidian-h2 whitespace-pre-line tracking-[-0.02em] text-foreground"> {headline} </h2> <div className="flex items-center gap-3"> <button type="button" onClick={onPrimaryClick} onMouseDown={() => setPressed("p")} onMouseUp={() => setPressed(null)} className={`${base} bg-primary text-primary-foreground shadow-[0_1px_2px_rgba(0,0,0,0.4),inset_0_0_0_1px_rgba(255,255,255,0.6)] hover:bg-[#e6e6e6] hover:shadow-[0_4px_14px_rgba(255,255,255,0.15),inset_0_0_0_1px_rgba(255,255,255,0.8)]`} data-pressed={pressed === "p"} > {primaryLabel} </button> <button type="button" onClick={onSecondaryClick} onMouseDown={() => setPressed("s")} onMouseUp={() => setPressed(null)} className={`${base} bg-[#1a1a1a] text-foreground shadow-[0_1px_2px_rgba(0,0,0,0.5),inset_0_0_0_1px_rgba(255,255,255,0.06)] hover:bg-[#262626] hover:shadow-[0_4px_14px_rgba(0,0,0,0.6),inset_0_0_0_1px_rgba(255,255,255,0.12)]`} data-pressed={pressed === "s"} > {secondaryLabel} </button> </div> </div> </section> ); }
Quality checks
Automated, in a real browser · 4d ago- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: not passed3 hard-coded colours (bg-[#e6e6e6], bg-[#1a1a1a], bg-[#262626]). These ignore the theme and break dark mode.
- Animates cleanly: doesn't applyDoesn't animate, so there's nothing to check.