Switch

Forms

A pill toggle with a stretchy pill thumb and clear checked state.

Live preview

Receive product updates.

Installation

Import the component from the kit. The package ships source and is transpiled by Next.js.

Import
import { Switch } from "@nphuonha/ui-kit";

Usage

Compose the component with your own content. All controls share the same focus, disabled and invalid states.

Usage
<Switch label="Notifications" defaultChecked />

API Reference

Props are additive to the underlying Base UI or native element.

PropTypeDefaultDescription
labelReactNode—Visible label.
descriptionReactNode—Helper text.
checkedboolean—Controlled checked state.
defaultCheckedboolean—Initial checked state.
disabledboolean—Disables the switch.