This topic is the discussion thread for the Vaadin documentation page Checkbox component | Vaadin components.
Questions, feedback, and comments are welcome here.
This topic is the discussion thread for the Vaadin documentation page Checkbox component | Vaadin components.
Questions, feedback, and comments are welcome here.
How to use a checkbox with the binder?
Like any other field, the field type is Boolean, but IIRC it binds just fine with the boolean (the primitive version) as well.
How can I add an icon to the text in the checkbox ?
Checkbox checkbox = new Checkbox(); checkbox.setLabelComponent(...);
The label is not showing up above the checkbox group even though I have set the label attribute. Why might this be the case? I am using lit.
Looks like you have to add `<label slot="label">Label text</label>` yourself, but this doesn't appear to be documented unless I missed it.
Edit: You also need the has-label attribute on <vaadin-checkbox-group>
No, that shouldn't be required, the `label` attribute should be enough. Did you remember to import `@vaadin/checkbox-group`?
Yes, at the top of the file:
import "@vaadin/checkbox"; import "@vaadin/checkbox-group";
And package.json:
"@vaadin/checkbox": "^24.8.0", "@vaadin/checkbox-group": "^24.8.0",
For some reason, it also seems like the `readonly` attribute does not propagate automatically to the inner checkboxes like it should.