Contents
- Checked and Unchecked
- Indeterminate
Having trouble getting help?
Contact Support
Contact Support
States in React Check box component
17 Mar 20253 minutes to read
The Essential® JS 2 CheckBox contains 3 different states visually, they are:
- Checked
- Unchecked
- Indeterminate
Checked and Unchecked
The CheckBox checked
property is used to handle the checked and unchecked state. In checked state a tick mark will be added to the visualization of CheckBox.
Indeterminate
The CheckBox indeterminate state can be set through indeterminate
property. CheckBox indeterminate state masks the real value of CheckBox visually. The Checkbox cannot be changed to indeterminate state through the user interface, this state can be achieved only through the property.
import { enableRipple } from '@syncfusion/ej2-base';
import { CheckBoxComponent } from '@syncfusion/ej2-react-buttons';
import * as React from 'react';
import * as ReactDom from 'react-dom';
enableRipple(true);
function App() {
return (<ul>
{/* checked state. */}
<li><CheckBoxComponent label="Checked State" checked={true}/></li>
{/* unchecked state. */}
<li><CheckBoxComponent label="Unchecked State"/></li>
{/* indeterminate state. */}
<li><CheckBoxComponent label="Indeterminate State" indeterminate={true}/></li>
</ul>);
}
export default App;
ReactDom.render(<App />, document.getElementById('check-box'));
import { enableRipple } from '@syncfusion/ej2-base';
import { CheckBoxComponent } from '@syncfusion/ej2-react-buttons';
import * as React from 'react';
import * as ReactDom from 'react-dom';
enableRipple(true);
function App() {
return (
<ul>
{/* checked state. */}
<li><CheckBoxComponent label="Checked State" checked={true} /></li>
{/* unchecked state. */}
<li><CheckBoxComponent label="Unchecked State" /></li>
{/* indeterminate state. */}
<li><CheckBoxComponent label="Indeterminate State" indeterminate={true} /></li>
</ul>
);
}
export default App;
ReactDom.render(<App />, document.getElementById('check-box'));