Skip to main content

Checkbox

Use the Checkbox to let users select one or more options from a list, or to confirm a selection that requires a further action such as clicking a submit button.

Import

import { Checkbox } from '@dynatrace/strato-components/forms';

Demo

Variants

The checkbox can be in either of the following states: checked, unchecked, or indeterminate, shown in this example.

Control state

The checkbox can also be controlled, meaning that you can handle the state. To do so, you need to use the onChange prop to provide a handler that is called when the internal state of the checkbox changes. You also need to assign the value from the state to the checkbox by setting the checked prop.

Validate

For validation patterns including custom hints and errors, see show custom hints and errors in the FormField documentation.

Still have questions?
Find answers in the Dynatrace Community