Strongtie Design System
Getting StartedComponents

Command Palette

Search for a command to run...

Getting Started
  • Introduction
  • Setup Guide
  • Package Installation
  • Code Quality Setup
  • Migration Guide
  • Resources
Registry
  • Getting Started
  • Combobox
  • Datepicker
  • MultiSelect
  • Tree
Guides
  • Framework Recommendations
Foundations
  • States
  • Variables
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Avatar
  • Badge
  • Breadcrumb
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Collapsible
  • Command
  • Combobox
  • Context Menu
  • Date Picker
  • Dialog
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • Hover Card
  • Input
  • Input Group
  • Item
  • Kbd
  • Label
  • Menubar
  • Multi Select
  • Navigation Menu
  • Pagination
  • Popover
  • Progress
  • Radio Group
  • Scroll Area
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Switch
  • Table
  • Tabs
  • Textarea
  • Toaster
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree
2026 Simpson Strong-Tie
  1. Docs
  2. Components
  3. Switch

Switch

PreviousNext

Switch is a toggle control for binary on/off states.

Switches provide a clear visual representation of binary choices, such as enabling or disabling features, turning settings on or off, or controlling boolean states. Unlike checkboxes which are typically used in forms for data submission, switches represent immediate state changes that take effect as soon as they're toggled. They provide clear visual feedback through their sliding animation, making the current state and the action of changing it immediately apparent to users.

Use switches for settings and preferences where the change takes effect immediately without requiring a save action. They work well in settings panels, preference screens, or anywhere users need to quickly toggle features on or off. Switches should always be paired with labels that clearly describe what is being turned on or off, and the current state should be visually obvious even without reading the label.

Example

"use client"

import { Switch } from "@strongtie/design-system/switch"

export function SwitchDefault() {
  return <Switch />
}

Installation

npm install @strongtie/design-system
import { Switch } from "@strongtie/design-system/switch"

Props

All components accept standard HTML attributes and React props.

Examples

"use client"

import { Switch } from "@strongtie/design-system/switch"

export function SwitchDefault() {
  return <Switch />
}

With Label

"use client"

import { Label } from "@strongtie/design-system/label"
import { Switch } from "@strongtie/design-system/switch"

export function SwitchWithLabel() {
  return (
    <div className="flex items-center gap-1 space-x-2">
      <Switch id="airplane-mode" />
      <Label htmlFor="airplane-mode">Airplane Mode</Label>
    </div>
  )
}

Styling

Components can be styled using the className prop. The design system uses Tailwind CSS for styling.

Classes

CSS classes used by this component:

  • switch

Accessibility

Ensure proper accessibility attributes are added when implementing this component.

SliderTab Nav

On This Page

ExampleInstallationPropsExamplesWith LabelStylingClassesAccessibility

Contribute

  • Report an issue
  • Request a feature
  • Edit this page