Buttons & actions / Floating buttons
Circular Icon Button
45px circle in canvas-deep with a bold dash icon, placed next to the CTA in the header.
Rebuilt from lusion.co in the Periwinkle Studio Float style.
npx shadcn@latest add https://justyoink.it/r/periwinkle-studio-float/blocks/circular-icon-button.json
Looks exactly like lusion.co: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/periwinkle-studio-float/mine/circular-icon-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 (aria-label, default "Toggle sound") and onClick callback. Drop it beside the header CTA; on hover it scales up and the dash swaps to a plus.
components/circular-icon-button.tsx
import { useState } from "react"; export default function CircularIconButton({ label = "Toggle sound", onClick, }: { label?: string; onClick?: () => void; }) { const [active, setActive] = useState(false); return ( <button type="button" aria-label={label} aria-pressed={active} onClick={() => { setActive((v) => !v); onClick?.(); }} className="group relative inline-flex h-[45px] w-[45px] items-center justify-center rounded-circle bg-canvas-deep text-ink transition-transform duration-snap ease-snap hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink focus-visible:ring-offset-2 focus-visible:ring-offset-canvas active:scale-95 motion-reduce:transition-none" > <span className="relative block h-[18px] w-[18px]"> <svg viewBox="0 0 18 18" fill="none" aria-hidden="true" className={`absolute inset-0 transition-all duration-standard ease-standard group-hover:scale-50 group-hover:opacity-0 ${active ? "rotate-90" : ""}`} > <path d="M2 9h14" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" /> </svg> <svg viewBox="0 0 18 18" fill="none" aria-hidden="true" className="absolute inset-0 scale-50 opacity-0 transition-all duration-standard ease-standard group-hover:scale-100 group-hover:opacity-100" > <path d="M9 2v14M2 9h14" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" /> </svg> </span> </button> ); }import { useState } from "react"; export default function CircularIconButton({ label = "Toggle sound", onClick, }: { label?: string; onClick?: () => void; }) { const [active, setActive] = useState(false); return ( <button type="button" aria-label={label} aria-pressed={active} onClick={() => { setActive((v) => !v); onClick?.(); }} className="group relative inline-flex h-[45px] w-[45px] items-center justify-center rounded-full bg-popover text-foreground transition-transform duration-periwinkle-snap ease-periwinkle-snap hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-foreground focus-visible:ring-offset-2 focus-visible:ring-offset-background active:scale-95 motion-reduce:transition-none" > <span className="relative block h-[18px] w-[18px]"> <svg viewBox="0 0 18 18" fill="none" aria-hidden="true" className={`absolute inset-0 transition-all duration-periwinkle-standard ease-periwinkle-standard group-hover:scale-50 group-hover:opacity-0 ${active ? "rotate-90" : ""}`} > <path d="M2 9h14" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" /> </svg> <svg viewBox="0 0 18 18" fill="none" aria-hidden="true" className="absolute inset-0 scale-50 opacity-0 transition-all duration-periwinkle-standard ease-periwinkle-standard group-hover:scale-100 group-hover:opacity-100" > <path d="M9 2v14M2 9h14" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" /> </svg> </span> </button> ); }
Quality checks
Automated, in a real browser · today- 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: 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.