Bundles save up to 25%. See every bundle

Code Boss
Dark

Full screen

What it does

A segmented control in frosted iOS-style glass for switching views, like Day / Week / Month / Year. When you pick another option, the pill stretches toward it and settles with a spring.

Good for
Dashboards, calendars, pricing toggles, app-style web UIs.
How it works
Tap an option or drag the pill across. The leading edge moves fast and the trailing edge catches up, so the pill stretches like a drop of water.
How to use
Copy two files, paste the markup, call init(). It fires onChange with the selected value.

Specs

Price
$12, one payment
Version
1.0.0
Code size
3.2 KB gzipped
Dependencies
None
Built with
HTML, CSS, JavaScript
Category
Navigation
Licence
Unlimited personal and client projects
In the zip
  • pinch.css pinch.jsthe component
  • index.htmla plain example page
  • README.mdsetup, CSS variables, API, React notes
  • package.json vite.config.js npm install npm run dev
  • LICENSE.md

Use it in your project

  1. Copy pinch.css and pinch.js into your project.
  2. Add the markup from index.html (the block between the COMPONENT comments).
  3. Start it:
import { init } from './pinch.js';
const pinch = init(document.querySelector('.pinch'), {
  onChange: (index, value) => console.log(index, value),
});

Mark the starting option with aria-checked="true". Each option's data-value is passed to onChange.

Questions

What exactly do I get?

The full source, a demo page and a README. No account, no framework.

Can I use it in client projects?

Yes, in unlimited projects. You can't resell or share the source itself.

Do I need React?

No. The README shows how to use it in React or Next.js.

Is it keyboard accessible?

Yes. It works as a radio group with the arrow keys, Home and End.

What if it doesn't work for me?

If it doesn't work like the demo, you get a refund within 14 days.

Still have a question? Email us. The person who made it answers.

Your cart

Your cart is empty. Browse components

Full screen