Buttons & actions / Buttons

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.

npx shadcn@latest add https://justyoink.it/r/obsidian-canvas-cc37fa/blocks/pill-button-set.json

Looks exactly like framer.com: brings its fonts and colours, namespaced so your own theme stays untouched.

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>
  );
}

Quality checks

Automated, in a real browser · 4d ago
—

More from Obsidian Canvas

The whole style →

Minimal Black Header

Headers & nav bars

Platform Bento Grid

Feature sections

Audience Icon Grid

Feature sections

Sticky-date Changelog Entry

Changelog

Neon Agent Prompt Hero

Heroes

Hairline Triple Feature Strip

Feature sections