Bundles save up to 25%. See every bundle

Code Boss
Dark

Full screen
See Dew in your colourBlue

What it does

An on/off switch in the iOS 26 style. While you press it, the knob swells past the track and turns into clear glass. When you let go, it slides across with a soft bounce.

Good for
Settings pages, preference panels, pricing toggles, mobile web apps.
How it works
Tap to toggle, or hold and drag the knob. The track fills with green as the knob moves, and letting go past the middle switches it on.
How to use
Copy two files, add a <button> per switch, call initAll(). Listen with onChange or the dew:change event.

Specs

Price
$5, one payment
Version
1.0.0
Code size
2.1 KB gzipped
Dependencies
None
Built with
HTML, CSS, JavaScript
Category
Toggle
Licence
Unlimited personal and client projects
In the zip
  • dew.css dew.jsthe component
  • index.htmla plain example page
  • README.md package.json vite.config.js LICENSE.md

Use it in your project

  1. Copy dew.css and dew.js into your project.
  2. Add the markup from index.html (the block between the COMPONENT comments). Give it a label with aria-labelledby or aria-label.
  3. Start it:
import { init, initAll } from './dew.js';
const wifi = init(document.querySelector('.dew'), { onChange: on => console.log(on) });
// or every switch on the page:
initAll('.dew');

Set the starting state with aria-checked="true". Each switch also fires a bubbling dew:change event with detail.checked.

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 a real switch for screen readers?

Yes. It's a <button role="switch"> with aria-checked, and Space and Enter work.

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