OfferLifetime Pro for $99

Web Shot Button

Bring the pointer near and thin threads leave the edge facing it, meet at the pointer and hang with a little slack, then let go and spring back when it leaves. Red glass by default, or black, blue, white or any tint; the label turns black on light glass. On a phone, press and drag out of the button.

CreativeFree350 lines · one file

The decision inside it

The threads leave from the edge that faces you

Each anchor sits on the outline nearest the pointer and slides around the curve as it moves, so a thread never crosses the label or cuts through the glass. Threads drawn from the centre look glued on as soon as the pointer goes above or below the button. The loop stops when nothing is moving, so a resting button costs nothing.

When to use it

Use Web Shot Button for one call to action people should want to play with, like the main action on a landing page. Red glass by default; pass color="clear" or any tint. Not for everyday buttons.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Layro's Web Shot Button for this.
Install it: npx shadcn@latest add @layro/web-shot-button
(the @layro registry is set up in components.json, with LAYRO_KEY in .env.local)
Import it from @/components/ui/web-shot-button.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Free components install through the @layro registry with your CLI token: see the Namespaced tab.

Usage

components/explore-button.tsx
import { ArrowRight } from "lucide-react";
import { WebShotButton } from "@/components/ui/web-shot-button";

export function ExploreButton({ onExplore }: { onExplore: () => void }) {
  return (
    <WebShotButton onClick={onExplore}>
      Explore components
      <ArrowRight />
    </WebShotButton>
  );
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

PropTypeNotes
size"md" | "lg"`md` (44px) or `lg` (56px). Default `lg`.
colorstringA hex or rgb() colour to tint the glass, or `"clear"` for untinted glass. Default red. The label turns black on light tints.
reachnumberHow far from the pill, in pixels, the pointer is noticed. Default 140.
threadsnumberNumber of threads. Default 5.

Dependencies

npm packages

clsxframer-motiontailwind-merge

Layro foundations, installed alongside it

layro-theme

States

All of them are drawn by the component. None is left for you to design.

  • Rest
  • Reaching
  • Springing back
  • Tinted glass
  • Light tint
  • Disabled
  • Reduced motion

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances