Switch

Toggles a setting between on and off. Use it when the change takes effect immediately rather than waiting for form submission.

React

Ready

Figma

React examples

SwitchField

SwitchField adds the label and description, and makes the whole row the target.

import { Stack, SwitchField } from "@kela-systems/ui-components";

export default function SwitchFieldExample() {
  return (
    <Stack gap={4} className="w-full max-w-sm">
      <SwitchField
        defaultChecked
        label="Auto-track"
        description="Keep the camera on the selected track."
      />
      <SwitchField label="Night mode" />
      <SwitchField
        variant="box"
        placement="end"
        label="Geofence alerts"
        description="Alert when a track crosses the north fence."
      />
    </Stack>
  );
}

Props

Switch

NameDefaultDescription
size
"sm" | "default"
"default"

It also takes the props of Base UI's switch.

SwitchField

NameDefaultDescription
size
"sm" | "default"
"default"
variant
"default" | "box"
"default"
placement
"start" | "end"
"start"
labelRequired
React.ReactNode
description
React.ReactNode

It also takes the props of Base UI's switch.

Read this page as Markdown

Search ARK

Find a page, a primitive or a component.