Skip to content
+

Checkbox

Checkboxes give users binary choices when presented with multiple options in a series.

Checkbox API

Import

import { Checkbox } from '@mui/base/Checkbox';
// or
import { Checkbox } from '@mui/base';
Learn about the difference by reading this guide on minimizing bundle size.

Props

Props of the native component are also available.

NameTypeDefaultDescription
checkedboolundefined

If true, the component is checked.

classNamefunc
| string
-

Class names applied to the element or a function that returns them based on the component's state.

defaultCheckedboolfalse

The default checked state. Use when the component is not controlled.

disabledboolfalse

If true, the component is disabled.

indeterminateboolfalse

If true, the checkbox will be indeterminate.

namestringundefined

Name of the underlying input element.

onChangefunc-

Callback fired when the state is changed.

Signature:function(event: React.ChangeEvent) => void
  • event The event source of the callback. You can pull out the new value by accessing event.target.value (string). You can pull out the new checked state by accessing event.target.checked (boolean).
readOnlyboolfalse

If true, the component is read only.

renderfunc-

A function to customize rendering of the component.

requiredboolfalse

If true, the input element is required.


The ref is forwarded to the root element.

Theme default props

You can use Checkbox to change the default props of this component with the theme.

CheckboxIndicator API

Import

import { CheckboxIndicator } from '@mui/base/Checkbox';
// or
import { CheckboxIndicator } from '@mui/base';
Learn about the difference by reading this guide on minimizing bundle size.

Props

Props of the native component are also available.

NameTypeDefaultDescription
classNamefunc
| string
-

Class names applied to the element or a function that returns them based on the component's state.

keepMountedboolfalse

If true, the indicator stays mounted when unchecked. Useful for CSS animations.

renderfunc-

A function to customize rendering of the component.


The ref is forwarded to the root element.

Theme default props

You can use CheckboxIndicator to change the default props of this component with the theme.