Pin Snap Toggle
Pin chip whose tack swings upright and turns gold when pinned, the whole chip picking up the same amber outline.
- lines of CSS
- 49lines of CSS
- dependencies
- 0dependencies
- baseline browsers
- Newlybaseline browsers
- motion only on interaction
- Hovermotion only on interaction
Vue, Svelte, styled-components and Tailwind exports are part of Pro. HTML, CSS and React are free forever.
.fx-v13-mi-pin-15572 {
display: inline-flex;
align-items: center;
gap: 0.55rem;
padding: 0.4rem 0.7rem 0.4rem 0.5rem;
font-size: 0.76rem;
color: #94a3b8;
background: #131c31;
border: 1px solid #253049;
border-radius: 999px;
cursor: pointer;
transition: border-color 0.25s ease, color 0.25s ease;
}
.fx-v13-mi-pin-15572 input { position: absolute; opacity: 0; width: 0; height: 0; }
.fx-v13-mi-pin-15572 .p {
position: relative;
display: grid;
place-items: center;
width: 24px;
height: 24px;
}
.fx-v13-mi-pin-15572 i {
display: block;
width: 8px;
height: 12px;
border-radius: 4px 4px 1px 1px;
background: #64748b;
transform: rotate(38deg) translateY(-2px);
transition: transform 0.3s cubic-bezier(0.34, 1.7, 0.64, 1), background 0.25s ease;
}
.fx-v13-mi-pin-15572 i::after {
content: '';
position: absolute;
left: 50%;
top: 12px;
width: 2px;
height: 8px;
margin-left: -1px;
background: inherit;
border-radius: 0 0 1px 1px;
}
.fx-v13-mi-pin-15572 em { font-style: normal; }
.fx-v13-mi-pin-15572 input:checked ~ .p i {
background: #fbbf24;
transform: rotate(0deg) translateY(0);
}
.fx-v13-mi-pin-15572:has(input:checked) { border-color: rgba(251,191,36,0.5); color: #fcd34d; }
.fx-v13-mi-pin-15572:hover i { transform: rotate(20deg) translateY(-1px); }
.fx-v13-mi-pin-15572:hover input:checked ~ .p i { transform: rotate(0deg) translateY(-2px) scale(1.1); }<label class="fx-v13-mi-pin-15572">
<input type="checkbox" checked />
<span class="p">
<i></i>
</span>
<em>Pinned to top</em>
</label>What do I do with this?
- Put
pin-snap-toggle-15573.cssanywhere your page already loads CSS from — in Next.js that isapp/globals.css, or any stylesheet with a<link>in your HTML. - Then put the class on the element you want it on:
<button class="fx-v13-mi-pin-15572">. The CSS does nothing until a class name in it matches something on the page.
- Link the stylesheet, then paste the markup wherever you need it.
npx hoverlab add pin-snap-toggle-15573What's included
- The markup and the stylesheet, in whichever framework you pick
- No runtime dependencies
Works with
- React
- Vue
- Svelte
- Tailwind
- styled-components
- Plain CSS
npx hoverlab add pin-snap-toggle-15573
Or over MCP, from your editor's agent — no account needed.
License
Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.
Motion safety
Static estimate, read from the CSS
- Reduced motion
- Brief motion, no guard
Animates briefly or on interaction. Only looping motion gets a guard in this catalog; copy the one from the Insights tab if this ships on a critical path.
- What it animates
- Repaints
Animates
background,border-color,color. No reflow, but the browser repaints every frame, which is fine for one element and costly across many. - Flashing (WCAG 2.3.1)
- No flashing found
No repeating change in opacity, colour or brightness large enough to count as a flash.
- Layout shift (CLS)
- No shift expected
Nothing it animates moves or resizes the box in flow. A category from the CSS, not a measurement for this effect.
Every row is read from the shipped CSS. Only a figure marked measured came from a browser. Customizing the speed changes the timing, so recheck a customized copy. How it is computed
34 more effects in Micro-interactions
All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.
Browse Micro-interactionsShipping one commercially
Copying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.
- A commercial licence for everything in the catalog
- Unlimited bundle exports, in Vue, Svelte and Tailwind
- One payment — no subscription, nothing to renew
7 variations of Pin Snap Toggle
Finished looks, each one a position in the customizer above. Copy any of them, or open it and keep moving the sliders.