Checkbox
- Usage
- Styling
Style Properties
The following style properties can be used in CSS stylesheets to customize the appearance of this component.
To apply values to these properties globally in your application UI, place them in a CSS block using the html {…}
selector.
See Lumo Style Properties for more information on style properties.
Note
|
Input Field Components Shared Styles
Style properties whose names start with --vaadin-input-field are shared among all input field components. To apply them only to a specific type of component, use an element selector like vaadin-text-field {…}
|
Checkbox Properties
Feature | Property | Default Value |
---|---|---|
Background |
|
|
Background, hover |
|
|
Background, disabled |
|
|
Border radius |
|
|
Checkmark character |
|
|
Checkmark character, indeterminate |
|
|
Checkmark color |
|
|
Checkmark color, disabled |
|
|
Checkmark size |
|
|
Label color |
|
|
Label font size |
|
|
Label padding |
|
|
Label
Feature | Property | Default Value |
---|---|---|
Color |
|
|
Focused color |
|
|
Hovered color |
|
|
Font size |
|
|
Font weight |
|
|
CSS Selectors
The following CSS selectors can be used in stylesheets to target the various parts and states of the component. See the Styling documentation for more details on how to style components.
Checkbox
- Root element
-
vaadin-checkbox
- Focused
-
vaadin-checkbox
[focused] - Keyboard focused
-
vaadin-checkbox
[focus-ring] - Disabled
-
vaadin-checkbox
[disabled] - Hovered
-
vaadin-checkbox
:hover - Pressed
-
vaadin-checkbox
[active] - Checked
-
vaadin-checkbox
[checked] - Indeterminate
-
vaadin-checkbox
[indeterminate] - Checkbox box
-
vaadin-checkbox
::part(checkbox) - Checkmark
-
vaadin-checkbox
::part(checkbox)::after - Label
-
vaadin-checkbox
> label
Checkbox Group
- Root element
-
vaadin-checkbox-group
States
- Focused
-
vaadin-checkbox-group
[focused] - Keyboard focused
-
vaadin-checkbox-group
[focus-ring] - Disabled
-
vaadin-checkbox-group
[disabled] - Hovered
-
vaadin-checkbox-group
:hover - One or more checkboxes checked
-
vaadin-checkbox-group
[has-value]
Parts
- Checkbox wrapper
-
vaadin-checkbox-group
::part(group-field) - Checkboxes
-
vaadin-checkbox-group
> vaadin-checkbox
Label
- Checkbox group with label
-
vaadin-checkbox-group
[has-label] - Label
-
vaadin-checkbox-group
::part(label) - Label text
-
vaadin-checkbox-group
> label - Required indicator
-
vaadin-checkbox-group
::part(required-indicator)
Helper and Validation Error
- Field with helper
-
vaadin-checkbox-group
[has-helper] - Helper
-
vaadin-checkbox-group
::part(helper-text) - Helper text
-
vaadin-checkbox-group
> [slot="helper"] - Invalid field
-
vaadin-checkbox-group
[invalid] - Error message
-
vaadin-checkbox-group
::part(error-message) - Error message text
-
vaadin-checkbox-group
> [slot="error-message"]