CheckBox
<ui5-checkbox>
Allows the user to set a binary value, such as true/false or yes/no for an item.
The ui5-checkbox
component consists of a box and a label that describes its purpose.
If it's checked, an indicator is displayed inside the box.
To check/uncheck the ui5-checkbox
, the user has to click or tap the square
box or its label.
The ui5-checkbox
component only has 2 states - checked and unchecked.
Clicking or tapping toggles the ui5-checkbox
between checked and unchecked state.
Usageβ
You can define the checkbox text with via the text
property. If the text exceeds the available width, it is truncated by default.
In case you prefer text to truncate, set the wrappingType
property to "None".
The touchable area for toggling the ui5-checkbox
ends where the text ends.
You can disable the ui5-checkbox
by setting the disabled
property to
true
,
or use the ui5-checkbox
in read-only mode by setting the readonly
property to true
.
Keyboard Handlingβ
The user can use the following keyboard shortcuts to toggle the checked state of the ui5-checkbox
.
- [Space],[Enter] - Toggles between different states: checked, not checked.
ES6 Module Importβ
import "@ui5/webcomponents/dist/CheckBox.js";