Dark Pill Disclosure Button
Charcoal pill with white medium-weight label and a small chevron, set on the dark hero.
Rebuilt from arc.net in the Obsidian Farewell Editorial style.
npx shadcn@latest add https://justyoink.it/r/obsidian-farewell-editorial/blocks/dark-pill-button.json
Looks exactly like arc.net: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/obsidian-farewell-editorial/mine/dark-pill-button.json
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: `label` for the button text and `panelText` for the content revealed below. Click toggles the disclosure, rotating the chevron; hover lightens the charcoal fill.
components/dark-pill-button.tsx
import { useState } from "react"; export default function DarkPillDisclosureButton({ label = "Read the notice", panelText = "Here is a little more detail, revealed beneath the button when you open it.", }: { label?: string; panelText?: string; }) { const [open, setOpen] = useState(false); return ( <div className="flex min-h-[240px] w-full flex-col items-center justify-start bg-canvas-dark px-6 py-16"> <button type="button" aria-expanded={open} aria-controls="pill-panel" onClick={() => setOpen((o) => !o)} className="inline-flex items-center gap-2 rounded-pill bg-surface-pill-dark px-6 py-[15px] font-sans text-ui font-medium text-white transition-colors duration-200 hover:bg-[#3a3a3a] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring" > {label} <svg width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true" className={`opacity-70 transition-transform duration-[250ms] motion-reduce:transition-none ${open ? "rotate-180" : ""}`} > <path d="M2.5 4.5 6 8l3.5-3.5" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" /> </svg> </button> <div id="pill-panel" className={`grid transition-[grid-template-rows] duration-[250ms] motion-reduce:transition-none ${open ? "grid-rows-[1fr]" : "grid-rows-[0fr]"}`} > <div className="overflow-hidden"> <p className="mt-4 max-w-xs text-center font-sans text-body text-on-dark-muted">{panelText}</p> </div> </div> </div> ); }import { useState } from "react"; export default function DarkPillDisclosureButton({ label = "Read the notice", panelText = "Here is a little more detail, revealed beneath the button when you open it.", }: { label?: string; panelText?: string; }) { const [open, setOpen] = useState(false); return ( <div className="flex min-h-[240px] w-full flex-col items-center justify-start bg-foreground px-6 py-16"> <button type="button" aria-expanded={open} aria-controls="pill-panel" onClick={() => setOpen((o) => !o)} className="inline-flex items-center gap-2 rounded-full bg-primary px-6 py-[15px] font-sans text-obsidian-ui font-medium text-primary-foreground transition-colors duration-200 hover:bg-[#3a3a3a] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring" > {label} <svg width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true" className={`opacity-70 transition-transform duration-[250ms] motion-reduce:transition-none ${open ? "rotate-180" : ""}`} > <path d="M2.5 4.5 6 8l3.5-3.5" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" /> </svg> </button> <div id="pill-panel" className={`grid transition-[grid-template-rows] duration-[250ms] motion-reduce:transition-none ${open ? "grid-rows-[1fr]" : "grid-rows-[0fr]"}`} > <div className="overflow-hidden"> <p className="mt-4 max-w-xs text-center font-sans text-obsidian-body text-background">{panelText}</p> </div> </div> </div> ); }
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 passed1 hard-coded colour (bg-[#3a3a3a]). These ignore the theme and break dark mode.
- Animates cleanly: doesn't applyDoesn't animate, so there's nothing to check.