Tessina UI
ConfiguratorGitHubIntroduction
InstallationUsageTheming
ComponentsAccordionAction SheetAlertAlertDialogArea ChartAspectRatioAvatarBadgeBannerBar ChartBottom NavBreadcrumbButtonButtonGroupCalendarCardCarouselChartChatBubbleCheckboxChipCodeBlockCollapsibleColor PickerComboboxCommandContainerContextMenuDate PickerDividerDrawerDropdown MenuEmptyStateFABFieldFieldsetFile UploadFile Upload 2FlexFormGridHoverCardIconButtonLabelLine ChartLinkMenubarMeterModalNavigation MenuNumberFieldOTP InputPaginationPie ChartPopoverProgressPromptInputRadar ChartRadial ChartRadioRatingScroll AreaSearchSegmentedControlSelectShortcutSidebarSkeletonSliderSpacerSpinnerSplit ButtonStackStatusStepperSurfaceSwitchTableTabsTextareaTime PickerToastToggleButtonToggleGroupToolbarTooltipTop Header DesktopTop Header Mobile
Contributing
Components

Switch

A toggle control that allows users to turn a setting on or off

Playground

Installation

pnpm add @tessinaui/ui

Usage

import { Switch } from "@tessinaui/ui";
<Switch label="Enable notifications" defaultChecked />

Examples

Default

A basic switch with a label, toggled on by default.

With Description

Pair a label with supporting description text for additional context.

Sizes

Three sizes — sm, md, and lg.

Label Position

Place the label and description on either the right (default) or left.

Disabled

Non-interactive switches in both the off and on states.

Loading

Skeleton placeholders shown while switch state is loading.

API Reference

Props

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"Size of the switch
checkedboolean—Controlled checked state
defaultCheckedbooleanfalseUncontrolled default state
onCheckedChange(checked: boolean) => void—Called when checked state changes
disabledbooleanfalseDisables the switch
labelstring—Label text displayed next to the switch
descriptionstring—Supporting description text below the label
labelPosition"left" | "right""right"Side of the switch the label appears on
showIconbooleantrueShow checkmark icon in the knob when on

Sizes

Three sizes are available:

  • sm — Compact (20px × 36px track)
  • md — Default (32px × 64px track, matches Figma design)
  • lg — Large (36px × 72px track)

States

StateDescription
OffDefault unchecked state
OnChecked state with success color and checkmark
Disabled offGreyed out, non-interactive
Disabled onChecked but non-interactive
FocusVisible focus ring for keyboard navigation

Accessibility

The Switch component:

  • Uses Radix UI's Switch primitive for full accessibility
  • Role: switch with aria-checked state
  • Keyboard: Space to toggle, Tab to focus
  • Label is associated via htmlFor / id
  • Includes visible focus-visible ring (WCAG 2.1 AA)
  • Touch target meets 44×44px minimum on all sizes
  • Disabled state communicated via aria-disabled

Surface

Declares an "on-color" tone for a colored or dark region so every nested button-family component automatically switches to high-contrast, surface-adaptive styling — set the surface once, no prop-drilling.

Table

A complete primitive set for tabular data — header, body, footer, sortable columns, sticky header, row states, plus cell helpers for avatars, status, currency amounts, and actions. Designed in the Wise / PrimeReact tradition.

On this page

PlaygroundInstallationUsageExamplesDefaultWith DescriptionSizesLabel PositionDisabledLoadingAPI ReferencePropsSizesStatesAccessibility