Kinetic UI
Back to Introduction
Forms

Switch

A control that allows the user to toggle between checked and not checked.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add switch

A control that allows the user to toggle between checked and not checked states.

Live Preview

Switch

Installation

npx kinetic-ui-cli@latest add switch

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { Switch } from "@/components/ui/switch";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { Switch } from "@/components/ui/switch";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <Switch
      />
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.