PropertyAttributeDescriptionTypeDefaultchecked checkedReflects the checkbox current checked state and allows setting the initial checked state.booleanfalsecompact compactDisplays as compact version.booleanfalsedisabled disabledMarks the checkbox as disabled.booleanfalseform formThe id of a form element the checkbox should be associated with.stringundefinedhideLabel 🛠hide-labelShow or hide label. For better accessibility it's recommended to show the label.boolean BreakpointCustomizable<boolean>falseindeterminate indeterminateMarks the checkbox as indeterminate.booleanfalselabel labelThe label text.string''loading 🧪loadingexperimental Disables the checkbox and shows a loading indicator.booleanfalsemessage messageThe message styled depending on validation state.string''name nameThe name of the checkbox.string''required requiredMarks the checkbox as required.booleanfalsestate stateThe validation state.type CheckboxState = 'none' 'error' 'success''none'theme themeAdapts the color depending on the theme.type Theme = 'light' 'dark' 'auto''light'value valueThe checkbox value. When a form is submitted, only a checkbox which is currently checked is included in the submission.string'on'
Events
prev
next
EventDescriptionTypeblur Emitted when the checkbox has lost focus.type CheckboxBlurEventDetail = Event CustomEvent<CheckboxBlurEventDetail>update Emitted when checkbox checked property is changed.type CheckboxUpdateEventDetail = { name: string; value?: string; checked: boolean; } CustomEvent<CheckboxUpdateEventDetail>
Slots
prev
next
SlotDescriptionisRequiredaltPropallowedTagNames<slot name="label"> Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed.<slot name="message"> Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed.