Duostrap Checkbox
A custom Duostrap checkbox built from Root and Indicator over Base Checkbox.
Duostrap Checkbox adapts the classic 14px beveled gradient control and blue focus glow with a custom Root and Indicator anatomy—requiring no legacy Bootstrap JavaScript or Glyphicons.
Preview
Section titled “Preview”<div class="flex items-center gap-3">
<wc-duostrap-checkbox-root default-checked>
<wc-duostrap-checkbox-indicator></wc-duostrap-checkbox-indicator>
</wc-duostrap-checkbox-root>
<wc-duostrap-label-root>
Accept terms and conditions
</wc-duostrap-label-root>
</div>Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases. Browse the implemented subset.
import { DuostrapCheckboxIndicator, DuostrapCheckboxRoot, DuostrapLabelRoot,} from '@proto.ui/prototypes-duostrap';
export function Example() { return ( <div className="flex items-center gap-2.5"> <DuostrapCheckboxRoot defaultChecked> <DuostrapCheckboxIndicator /> </DuostrapCheckboxRoot> <DuostrapLabelRoot>Accept terms and conditions</DuostrapLabelRoot> </div> );}- Root manages the state: Supports controlled and uncontrolled
checkedandindeterminate, pointer andSpaceactivation, disabled and read-only policies, focus, and thecheckboxrole withmixedstate. - Indicator: Place inside
Rootto render the dark tick or dash automatically;indeterminatetakes visual precedence overchecked. - Classic feedback and palette: Hover and press use Duostrap beveled gradients, keyboard focus displays the
#52a8ecglow, and the control keeps its classic light face even in dark hosts.
Examples
Section titled “Examples”Description
Section titled “Description”<div class="flex items-center gap-3">
<wc-duostrap-checkbox-root default-checked>
<wc-duostrap-checkbox-indicator></wc-duostrap-checkbox-indicator>
</wc-duostrap-checkbox-root>
<wc-duostrap-label-root>
Accept terms and conditions
</wc-duostrap-label-root>
</div>Disabled and read-only
Section titled “Disabled and read-only”<div class="flex items-center gap-3">
<wc-duostrap-checkbox-root disabled>
<wc-duostrap-checkbox-indicator></wc-duostrap-checkbox-indicator>
</wc-duostrap-checkbox-root>
<wc-duostrap-label-root>
Enable notifications
</wc-duostrap-label-root>
</div>Controlled and indeterminate
Section titled “Controlled and indeterminate”<div class="flex items-center gap-3">
<wc-duostrap-checkbox-root indeterminate>
<wc-duostrap-checkbox-indicator></wc-duostrap-checkbox-indicator>
</wc-duostrap-checkbox-root>
<wc-duostrap-label-root>
Sync workspace preferences
</wc-duostrap-label-root>
</div><div class="flex items-center gap-3">
<wc-duostrap-checkbox-root default-checked>
<wc-duostrap-checkbox-indicator></wc-duostrap-checkbox-indicator>
</wc-duostrap-checkbox-root>
<wc-duostrap-label-root>Hard disks</wc-duostrap-label-root>
</div><div class="flex items-center gap-3">
<wc-duostrap-checkbox-root indeterminate>
<wc-duostrap-checkbox-indicator></wc-duostrap-checkbox-indicator>
</wc-duostrap-checkbox-root>
<wc-duostrap-label-root>Select all rows</wc-duostrap-label-root>
</div>| Prop | Type | Default |
|---|---|---|
checked | boolean undefined | uncontrolled |
defaultChecked | boolean | false |
indeterminate | boolean undefined | uncontrolled |
defaultIndeterminate | boolean | false |
disabled | boolean | false |
readOnly | boolean | false |
required | boolean | false |
Root exposes checked, indeterminate, disabled, readOnly, required, hovered, focused, focusVisible, and pressed states, focusSelf(options?) and resetValue() methods, and checkedChange ({ checked, indeterminate }) and indeterminateChange ({ indeterminate }) events.
Indicator
Section titled “Indicator”Indicator declares no props of its own. Place it inside Root to sync checked and mixed marks automatically; it exposes checked, indeterminate, isChecked(), and isIndeterminate().