Skip to main content


Checkboxes are used to let a user choose one or more options from a limited number of options.


Open in new window
<duet-checkbox checked label="Checked" value="test"></duet-checkbox>

// Select the above checkbox
var checkbox = document.querySelector("duet-checkbox")

// Listen for changes in the checkbox
checkbox.addEventListener("duetChange", function(e) {
console.log("Change detected in checkbox", e.detail)
Open in new window
<duet-checkbox label="Unchecked"></duet-checkbox>
Open in new window
<duet-checkbox checked disabled label="Disabled"></duet-checkbox>
Open in new window
<duet-checkbox checked label="Option 1"></duet-checkbox>
<duet-checkbox label="Option 2"></duet-checkbox>
<duet-checkbox label="Option 3"></duet-checkbox>
Open in new window
<duet-grid responsive breakpoint="small">
<duet-grid-item margin="none" fill>
<duet-checkbox checked label="Option 1"></duet-checkbox>
<duet-grid-item margin="none" fill>
<duet-checkbox label="Option 2"></duet-checkbox>
<duet-grid-item margin="none" fill>
<duet-checkbox label="Option 3"></duet-checkbox>

Properties #

Property Attribute Description Type Default
accessibleActiveDescendant accessible-active-descendant Indicates the id of a related component’s visually focused element. string undefined
accessibleControls accessible-controls Use this prop to add an aria-controls attribute. Use the attribute to indicate the id of a component controlled by this component. string undefined
accessibleIndex accessible-index Control the tabindex of checkbox. In most cases this should never be used! It exists only for Duet’s internal needs. string undefined
accessibleOwns accessible-owns Indicates the id of a component owned by the checkbox. string undefined
checked checked Check state of the checkbox. boolean false
disabled disabled Makes the checkbox component disabled. This prevents users from being able to interact with the checkbox, and conveys its inactive state to assistive technologies. boolean false
identifier identifier Adds a unique identifier for the checkbox. string undefined
label label Label for the checkbox string "label"
labelHidden label-hidden Visually hide the label, but still show it to screen readers. boolean false
margin margin Controls the margin of the component. "auto" | "none" "auto"
name name Name of the checkbox. string undefined
required required Set whether the input is required or not. boolean false
role role Defines a specific role attribute for the input. string undefined
theme theme Theme of the checkbox. "" | "default" | "turva" ""
value value The value of the checkbox does not mean if it's checked or not, use the checked property for that. string undefined

Events #

Event Description Type
duetBlur Emitted when the checkbox loses focus. CustomEvent<{ originalEvent?: Event; checked: boolean; value: string; component: "duet-checkbox"; }>
duetChange Emitted when the checked property has changed. CustomEvent<{ originalEvent?: Event; checked: boolean; value: string; component: "duet-checkbox"; }>
duetFocus Emitted when the checkbox has focus. CustomEvent<{ originalEvent?: Event; checked: boolean; value: string; component: "duet-checkbox"; }>

Methods #

setFocus() => Promise<void> #

Sets focus on the specified duet-checkbox. Use this method instead of the global

Returns #

Type: Promise<void>


For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.


Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:


Building Layouts


Using CLI Tools


Creating Custom Patterns


Server Side Rendering


Sharing Prototypes


Usage With Markdown


If you experience any issues while using a component, please head over to the Support page for more guidelines and help.