Browse components
Slingshot
Pull the button back on rubber bands and let go: past the threshold it fires and whips home with overshoot. A normal click works too.
Installation
npx shadcn@latest add @glint-ui/slingshotFirst time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/slingshot.json
Usage
import { Slingshot } from "@/components/ui/slingshot";
<Slingshot threshold={50} onClick={() => fire()}>Launch</Slingshot>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Button label. |
| threshold | number | 50 | Px the button must be pulled back to fire on release. |
| elasticity | number | 0.5 | How far the button follows the pointer while pulled. |
| className | string | — | Extra classes for the root element. |