For more examples, visit the Storybook.

Example
    <StudsCheckbox name="checkbox" />

Props

checked
boolean
default:"false"

The controlled checked state of the checkbox

disabled
boolean
default:"false"

When true, prevents the user from interacting with the checkbox

required
boolean
default:"false"

When true, indicates that the user must check the checkbox before the form can be submitted

name
string

The name of the checkbox. Submitted with its form data

value
string

The value of the checkbox. Submitted with its form data

defaultChecked
boolean
default:"false"

The default checked state of the checkbox

onCheckedChange
function

Event handler called when the checked state changes