Skip to main content

Checkbox

This element allow the user to select one or more items from a set.

Properties

NameTypeDescription
namestringName of the element
labelTextstringCaption text of the element
checkedbooleanWhen set to true, element is checked by default
disabledbooleanWhen set to true, disables the element
checkboxStyleCheckboxStyleStyling properties and values of the element

CheckboxStyle

Styling properties and values of the element

NameDescription
widthSets the width of the element
heightSets the height of the element
borderSets the border of the element
borderRadiusSets the border radius of the element
backgroundSets all background style properties at once, such as color, image, origin and size, or repeat method. Reference link
labelTextFontSets all the different properties of font for the caption text. Reference link
labelTextColorSets the foreground color of caption text.
checkedBackgroundColorSets the background color when the element is in checked state
uncheckedBackgroundColorSets the background color when the element is in unchecked state

Events

Events triggered by the element

NameDescription
cc-checkbox-changedTriggered when user updates or modifies the element

Usage

import '@cometchat/uikit-elements';//import the web component package.

const changeHandler = event => {
console.log(event.detail.checked);
}

<cometchat-checkbox
:labelText="Checkbox 1"
:checked="true"
@cc-checkbox-changed="changeHandler($event)" />