Duostrap Toggle
A Duostrap toggle button built over Base Toggle with classic gradients, inset active styling, variants, and pixel sizes.
Duostrap Toggle pairs the classic Duostrap button gradient and inset pressed paint with Base Toggle’s two-state protocol, keeping its archived palette readable across light and dark hosts.
Preview
Section titled “Preview”<div class="flex flex-wrap items-center gap-3">
<wc-duostrap-toggle>Bold</wc-duostrap-toggle>
<wc-duostrap-toggle default-active>Italic</wc-duostrap-toggle>
<wc-duostrap-toggle default-active disabled>
Unavailable
</wc-duostrap-toggle>
</div>Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases. Browse the implemented subset.
import { BootstrapToggle } from '../proto-ui/components/react';<BootstrapToggle variant="primary" defaultActive> Bold</BootstrapToggle>- Classic variants & sizes: Supports all seven Duostrap color variants (
default,primary,success,info,warning,danger,inverse) and four classic pixel sizes (mini,small,default,large). - Controlled & uncontrolled: Supports controlled
activeand uncontrolleddefaultActive, pointer andEnter/Spaceactivation, disabled suppression, andaria-pressedsemantics. - Grouped toggles: For coordinated sets of toggle buttons, use Toggle Group.
Examples
Section titled “Examples”Variants
Section titled “Variants”Compare all seven classic Duostrap button color variants as toggle controls.
<div class="flex flex-wrap items-center gap-2">
<wc-duostrap-toggle variant="default">Default</wc-duostrap-toggle>
<wc-duostrap-toggle variant="primary" default-active>
Primary
</wc-duostrap-toggle>
<wc-duostrap-toggle variant="success">Success</wc-duostrap-toggle>
<wc-duostrap-toggle variant="info">Info</wc-duostrap-toggle>
<wc-duostrap-toggle variant="warning">Warning</wc-duostrap-toggle>
<wc-duostrap-toggle variant="danger">Danger</wc-duostrap-toggle>
<wc-duostrap-toggle variant="inverse">Inverse</wc-duostrap-toggle>
</div>With Text
Section titled “With Text”Combine icons and text labels with classic 4px button spacing.
<div class="flex flex-wrap items-center gap-2">
<wc-duostrap-toggle>Bold</wc-duostrap-toggle>
<wc-duostrap-toggle default-active>Italic</wc-duostrap-toggle>
<wc-duostrap-toggle>Underline</wc-duostrap-toggle>
</div>Switch between mini, small, default, and large pixel sizes.
<div class="flex flex-wrap items-center gap-2">
<wc-duostrap-toggle size="mini">Mini</wc-duostrap-toggle>
<wc-duostrap-toggle size="small">Small</wc-duostrap-toggle>
<wc-duostrap-toggle size="default" default-active>
Default
</wc-duostrap-toggle>
<wc-duostrap-toggle size="large">Large</wc-duostrap-toggle>
</div>Disabled
Section titled “Disabled”Disabled toggles flatten the gradient, drop elevation, and block activation while preserving any active state.
<div class="flex flex-wrap items-center gap-2">
<wc-duostrap-toggle disabled>Disabled</wc-duostrap-toggle>
<wc-duostrap-toggle default-active disabled>
Active Disabled
</wc-duostrap-toggle>
<wc-duostrap-toggle variant="primary" disabled>
Primary Disabled
</wc-duostrap-toggle>
</div>The following props belong to Root (pass active for controlled mode):
| Prop | Type | Default |
|---|---|---|
active | boolean undefined | uncontrolled |
defaultActive | boolean | false |
disabled | boolean | false |
variant | 'default' 'primary' 'warning' 'danger' 'success' 'info' 'inverse' | 'default' |
size | 'default' 'large' 'small' 'mini' | 'default' |
- Events:
activeChange(payload{ active: boolean }). - Methods:
focusSelf(options?)(no-op while disabled). - Exposed states:
active,disabled,hovered,focused,focusVisible,pressed.