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';
Props of the native component are also available.
Name | Type | Default | Description |
---|---|---|---|
checked | bool | undefined | If |
className | func | string | - | Class names applied to the element or a function that returns them based on the component's state. |
defaultChecked | bool | false | The default checked state. Use when the component is not controlled. |
disabled | bool | false | If |
indeterminate | bool | false | If |
name | string | undefined | Name of the underlying input element. |
onChange | func | - | Callback fired when the state is changed. Signature: function(event: React.ChangeEvent
|
readOnly | bool | false | If |
render | func | - | A function to customize rendering of the component. |
required | bool | false | If |
ref
is forwarded to the root element.Theme default props
You can useCheckbox
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';
Props of the native component are also available.
Name | Type | Default | Description |
---|---|---|---|
className | func | string | - | Class names applied to the element or a function that returns them based on the component's state. |
keepMounted | bool | false | If |
render | func | - | A function to customize rendering of the component. |
ref
is forwarded to the root element.Theme default props
You can useCheckboxIndicator
to change the default props of this component with the theme.