Skip to component details
EXEPERTAI LAB
ProductCapabilitiesTrustFAQUI GalleryBlogNews
Sign inOpen app ↗
ProductCapabilitiesTrustFAQUI GalleryBlogNewsSign in
← Browse gallery
Forms·@exepert/ui / Switch

Switch

A binary setting for an immediate on or off choice.

Open in Playground ↗All components

Variants and states

3 copy-ready examples

On state

An enabled preference uses an affirmative label.

Open in Playground ↗
Starting preview…
import { Switch } from "@exepert/ui";
import "@exepert/ui/styles.css";
export default function Example() {
  return (
    <Switch defaultChecked label="Show live traces" />
  );
}

Usage

Use when changing the setting takes effect immediately.

Props

  • label: ReactNode
  • defaultChecked: boolean
  • description: ReactNode
  • disabled: boolean

Accessibility

  • Exposes checked state with a switch role.
  • Avoid using a switch for tri-state or multi-option settings.

Install

Install the pinned public release, then import the component and stylesheet.

npm install @exepert/ui@0.1.0

import { Switch } from "@exepert/ui";

import "@exepert/ui/styles.css";

EXEPERTAI LAB

Compare supported models, inspect system behaviour, and understand the context around each result.

PrivacyTermsContact

EXEPERT AI is an independent software and AI research lab in Malaysia

Malaysia · hello@exepert.com

Open in Gmail ↗

© 2026 EXEPERT AI. All rights reserved.