Skip to Content
Forms & Inputs@hacline/ui/switch

Switch

A toggle switch built on @ui-sdk/react/switch with controlled and uncontrolled state, sm/md sizes, Space key toggling, and Field form integration.

Import

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

Basic Usage

Pair with Field (orientation="horizontal") and FieldLabel to bind the label automatically, allowing users to toggle the switch by clicking the label.

Status: Enabled

Submitting Boolean Settings

Associate the switch with a form field. Your app saves the switch state based on whether the field is present in the submitted form data.

Props

Prop

Type