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.

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

Quality checks

Automated, in a real browser · today
—

More from Periwinkle Studio Float

The whole style →

Tilted Panel Loader

Animated graphics

Floating Pill Header

Headers & nav bars

Oversized Section Heading with Side Blurb

Feature sections

Rounded Project Tile

Cards

Dot-Separated Category Tags

Badges & tags

Plus Crosshair Grid Markers

Animated backgrounds