Component packs › Fastener › Snap Button

Snap Button

The stud pops into its socket with a squash and a rebound, the cloth dimples and a ripple runs out through the weave.

Snap Button is a toggle from Fastener, a component pack with 6 fastener controls: Controls that fasten like clothing: zips that mesh, studs that snap, hook-and-loop that tears, buckles that click. Price: $2 for the whole pack.

Built with: spring pop, cloth ripple, flap lifts when open.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Snap Button props

PropTypeDefaultDescription
checkedboolean
disabledboolean
labelstring"Fasten"Accessible name. Default "Fasten".
states[string, string]["Open", "Fastened"]Printed state words. Default ["Open", "Fastened"].
onChange(checked: boolean) => void

Methods on the ref

Use it in React

import SnapButton from './SnapButton';

<SnapButton />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Fastener

Good for: Buttons.