profound-logoProfound CMS
⌘K
Admin
Theme
DocsTutorialBlogPhilosophy
DocsTutorialBlogPhilosophy

Blog

Static Blog PostSetup Hybrid CMS ProjectTailwind TokenswitchOur TeamFallow and LLM-assisted cleanup
All Systems Operational
Powered Byprofound-logo
Theme

switch

Documentation on the Switch system-design

Design-system wrapper around Radix Switch.Root and Switch.Thumb.

Import

import { Switch } from '@repo/design-system';

Usage

<Switch checked={enabled}  />
<Switch
  label="Required"
  checked={field.required}
   => updateField({ required: checked })}
/>
<Switch
  slim
  checked={enabled}
  
/>

Props

PropTypeDefaultDescription
labelReactNode-Optional visible label
slimbooleanfalseTighter wrapper layout
sizedefaultsmdefaultSwitch size
wrapperClassNamestring-Styles the outer wrapper
switchClassNamestring-Styles the switch track
thumbClassNamestring-Styles the thumb

All Radix Switch.Root props are also supported, including checked, onCheckedChange, disabled, and ARIA props.

Patterns

Use label for short inline text:

<Switch label="Page Slug" checked={enabled}  />

Use external text when you need a title and description layout:

<div className="flex items-start justify-between gap-3">
  <div>
    <p>Use as Page Slug</p>
    <p>This field will be used for URL routing.</p>
  </div>
  <Switch slim checked={enabled}  />
</div>

Accessibility

If you do not provide label, add aria-label or aria-labelledby.

<Switch aria-label="Enable auto deploy" checked={enabled}  />
Continue Reading
Previousβ€ΉTailwind TokenNextOur Teamβ€Ί