Components

A toggle control for enabling or disabling settings.

Installation

npm install @mijn-ui/react-switch

Usage

import { Switch } from "@mijn-ui/react-switch"
<Switch />

API Reference

Built on Radix UI — all underlying primitive props are forwarded in addition to the props below.

PropTypeDefaultDescription
unstyledbooleanfalseOpt out of the default styles to fully customize the component.
classNamesobjectOverride classes per slot (see Style Slots below).
classNamestringAdditional classes for the root element.

Switch Style Slots

Slot NameTargeted ComponentPurpose
baseSwitchStyles the root switch component.
thumbSwitchStyles the thumb of the switch.