@htmlbricks/hb-input-checkbox
v0.71.32
Published
Checkbox or, when `schemaentry.params.type` is `switch`, a switch styled with Bulma theme variables on `:host`. Labeled from `schemaentry.label` with a required asterisk when needed. Boolean `value` is parsed from stringified `schemaentry`; required field
Readme
hb-input-checkbox — input-checkbox
Category: inputs
Tags: inputs
What it does
Checkbox or, when schemaentry.params.type is switch, a switch styled in the shadow tree (Bulma colors on :host), labeled from schemaentry.label with a required asterisk when needed. Boolean value is parsed from stringified schemaentry; required fields must be checked to be valid. Dispatches setVal with { value, valid, id } and shows validationTip as Bulma help is-danger when show_validation is yes and invalid.
Styling (Bulma)
Shadow bundle: form/shared, form/input-textarea, form/checkbox-radio, form/tools. Switch uses host SCSS (hb-input-checkbox-switch).
Custom element
hb-input-checkbox
Attributes (snake_case; use string values in HTML)
id— optional stringstyle— optional stringschemaentry— required string (JSON:id,label?,required?,value?,validationTip?,params.typeoptional"switch", …)show_validation— optional"yes"|"no"
Events
setVal—{ value: boolean; valid: boolean; id: string }
Usage notes
CSS parts: input, invalid-feedback.
Minimal HTML example
<hb-input-checkbox
schemaentry="{"id":"accept","label":"I agree","required":true}"
show_validation="no"
></hb-input-checkbox>