ComponentsNew

Lever Switch

A metal toggle lever on a dark plate with two lamps. The lever flips up and down and the matching lamp lights up.

Customize

onColor
offColor

Based on soft-pug-40 by csemszepp (MIT license) · Terms of use

More in Pro

View all

Props

11 properties
PropertyTypeDefaultDescription
defaultCheckedbooleantrueWhether the lever starts on.
checkedboolean—Controlled state. Without it the lever keeps its own state.
onCheckedChange(checked: boolean) => void—Called with the new state after every flip.
sizenumber12Scale in pixels per em. The plate is 6.8 by 12.8 em.
onColorstring"#fafafa"Glow of the top lamp when on.
offColorstring"#737373"Glow of the bottom lamp when off.
onLabelstring"ON"Caption above the top lamp.
offLabelstring"OFF"Caption below the bottom lamp.
disabledbooleanfalseDisable the lever.
labelstring"Power"Accessible name of the lever.
classNamestring—Classes for the wrapper.

Dependencies

2 required packages

npm install clsx tailwind-merge

Related components

View all