Buttons & actions / Floating buttons
Glass Circular Play Button
Small translucent circular button with play triangle placed at the corner of media tiles.
Rebuilt from mercury.com in the Twilight Ledger style.
npx shadcn@latest add https://justyoink.it/r/twilight-ledger-0e1ecf/blocks/glass-circle-button.json
Looks exactly like mercury.com: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/twilight-ledger-0e1ecf/mine/glass-circle-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
Renders a translucent circular play/pause button over a small sample tile. Props: label (aria-label when paused), defaultPlaying, and onToggle(playing) callback; clicking toggles the icon and hover brightens the glass.
components/glass-circle-button.tsx
import { useState } from "react"; export default function GlassCircularPlayButton({ label = "Play animation", defaultPlaying = false, onToggle }: { label?: string; defaultPlaying?: boolean; onToggle?: (playing: boolean) => void }) { const [playing, setPlaying] = useState(defaultPlaying); return ( <div className="relative flex h-40 w-72 items-end rounded-xl bg-powder-blue p-3"> <div className="absolute left-6 top-6 rounded-md bg-white px-4 py-3 text-ink-dark shadow-card-lift"> <p className="text-label">Ops / Payroll</p> <p className="text-caption text-ink-dark-muted">$2,023,267.12</p> </div> <button type="button" aria-label={playing ? "Pause animation" : label} aria-pressed={playing} onClick={() => { const next = !playing; setPlaying(next); onToggle?.(next); }} className="relative flex h-10 w-10 items-center justify-center rounded-pill border border-ink-dark/20 bg-glass-fill text-ink-dark backdrop-blur-md transition-colors duration-hover-wash ease-hover-wash hover:bg-white/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent" > {playing ? ( <svg width="14" height="14" viewBox="0 0 14 14" fill="currentColor" aria-hidden="true"> <rect x="2" y="1" width="3.5" height="12" rx="1" /> <rect x="8.5" y="1" width="3.5" height="12" rx="1" /> </svg> ) : ( <svg width="14" height="14" viewBox="0 0 14 14" fill="currentColor" aria-hidden="true"> <path d="M3 1.5v11a.8.8 0 0 0 1.2.7l9-5.5a.8.8 0 0 0 0-1.4l-9-5.5A.8.8 0 0 0 3 1.5Z" /> </svg> )} </button> </div> ); }import { useState } from "react"; export default function GlassCircularPlayButton({ label = "Play animation", defaultPlaying = false, onToggle }: { label?: string; defaultPlaying?: boolean; onToggle?: (playing: boolean) => void }) { const [playing, setPlaying] = useState(defaultPlaying); return ( <div className="relative flex h-40 w-72 items-end rounded-2xl bg-foreground p-3"> <div className="absolute left-6 top-6 rounded-lg bg-foreground px-4 py-3 text-background shadow-twilight-card-lift"> <p className="text-twilight-label">Ops / Payroll</p> <p className="text-twilight-caption text-muted-foreground">$2,023,267.12</p> </div> <button type="button" aria-label={playing ? "Pause animation" : label} aria-pressed={playing} onClick={() => { const next = !playing; setPlaying(next); onToggle?.(next); }} className="relative flex h-10 w-10 items-center justify-center rounded-full border border-muted-foreground/20 bg-secondary text-muted-foreground backdrop-blur-md transition-colors duration-twilight-hover-wash ease-twilight-hover-wash hover:bg-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary" > {playing ? ( <svg width="14" height="14" viewBox="0 0 14 14" fill="currentColor" aria-hidden="true"> <rect x="2" y="1" width="3.5" height="12" rx="1" /> <rect x="8.5" y="1" width="3.5" height="12" rx="1" /> </svg> ) : ( <svg width="14" height="14" viewBox="0 0 14 14" fill="currentColor" aria-hidden="true"> <path d="M3 1.5v11a.8.8 0 0 0 1.2.7l9-5.5a.8.8 0 0 0 0-1.4l-9-5.5A.8.8 0 0 0 3 1.5Z" /> </svg> )} </button> </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: not passedElements must meet minimum color contrast ratio thresholds (1 element)
- Themeable: passedUses design tokens rather than hard-coded colours, so it follows your theme cleanly.
- Animates cleanly: doesn't applyDoesn't animate, so there's nothing to check.