Reactolith UI Getting Started Introduction Installation Usage Layout Aspect Ratio Card Resizable Scroll Area Separator Direction Provider Forms Button Button Group Calendar Checkbox Combobox Field Input Input Group Input OTP Label Native Select Radio Group Select Slider Switch Textarea Toggle Toggle Group Data Display Accordion Avatar Badge Carousel Chart Collapsible Item Kbd Table Feedback Alert Empty Progress Skeleton Sonner Spinner Overlay Alert Dialog Context Menu Dialog Dropdown Menu Hover Card Popover Sheet Tooltip Navigation Breadcrumb Command Menubar Navigation Menu Pagination Sidebar Tabs

Toggle

A two-state button that can be either on or off.

Preview

B I U

Usage

<div class="flex items-center gap-2">
  <ui-toggle>B</ui-toggle>
  <ui-toggle>I</ui-toggle>
  <ui-toggle variant="outline">U</ui-toggle>
</div>

Sub-components

<ui-toggle>

Props

<ui-toggle> Custom wrapper

PropTypeDefaultDescription
variant"default" | "outline""default"Visual variant.
size"default" | "sm" | "lg""default"Toggle size.
pressedbooleanControlled pressed state.
hrefstringURL to navigate to. Renders as a link when set. (Custom prop)

All components also accept standard HTML attributes (class, id, style, data-*, aria-*, etc.) which are passed through to the underlying element.