Skip to content

Custom Checkbox

If you're looking for more appealing and sophisticated designs for your forms, you can use our ECheckboxCustom to deliver a combination of beauty and utility. Demo Here

Usage

vue

<template>
  <ECheckboxCustom
      :contents="checkboxContents"
      v-model="selectedValue"
  />
</template>

<script setup>
  const checkboxContents = ref([
    {
      title: "Graphic design",
      value: "g-design",
    },
    {
      title: "Web design",
      value: "d-design",
    },
  ]);
  const selectedValue = ref();
</script>

NOTE

To display the ECheckboxCustomelement, the title property must be present. All other attributes are optional.

js
  const contents = [{
  title: "Graphic Design",
  value: "g-design",  // if not defined, the index of item will be used.
  description: "Innovate. Inspire. Impact.",
  icon: {
      name: "Global",
      iconPack: "iconsax",
      size: 30,
      color: "#ABAFE6",
      type: "bulk",
  }
}];
js
  const contents = [{
  title: "Graphic Design",
  value: "g-design",  // if not defined, the index of item will be used.
  description: "Innovate. Inspire. Impact.",
  img: {
      src: "/graphic.jpg",
      alt: "graphic design",
      class: "",
  }
}];

Props

For ECheckboxCustom component, the following props are available:

PropTypeDefaultNote
modelValueArray-Checked Item(s).
contentsArray-Checkbox content.
labelString-Component's label
widthString-Sets the component's width.
heightString-Sets the component's height.
actionButtonBooleanfalseDisplays the checkbox button.
messageString-Adds a message below the checkbox.
verticalBooleanfalseIt organizes your checkbox vertically.
disabledBooleanfalseDisables the ECheckboxCustom content.
tickBadgeBooleanfalseDisplays a tick mark if the state if true.
validateOnString"input"Triggers validation on @values: submit, input.
nameString-HTML name attribute..
growBooleanfalseMakes the checkbox expand to fit the full container width.
rulesArray-Validation rules. For more info refer to Form Validation.
sizeString"md"The ECheckboxCustom element has three predefined sizes: sm, md, lg.
squareBooleanfalseRemoves rounded corners of the element.
colorString"primary"The given color is applied to the element - utility colors are supported (e.g primary or danger). you'll find a list of built-in classes on the src/styles/_vars.scsspage.
stateString-Validates the user-provided data against established criteria and performs display validation. States can be none if no validation is necessary, danger if the selected is valid, or success if it is acceptable.

Emits

The ECheckboxCustom component contains following emits.

EmitDescription
update:modelValueControls the checked status of the element(s).

COPYRIGHT