Basic

A SwitchIcon swaps the outline icon for the filled one in activeColor.

Animations

Pick a transition with variant: fade, scale, flip or one of the slides.

Two icons

Set activeIcon to switch to a different icon instead of the filled variant.

In an action button

Add action to wrap the switch in a btn-action, which then carries the toggle, hover and focus.

Loading

Add loading to show a spinner in place of the icons; clicks are ignored.

Wait for a request

Pass a promise to event.wait() and the switch waits for it. The last one fails and stays as it was.

In a list

The event bubbles, so one listener on the list keeps the count in sync.

tabler/tabler
Dashboard UI kit
tabler/tabler-icons
5900+ free SVG icons
tabler/tabler-react
React components
tabler/tabler-emails
Responsive email templates
2 starred