Skip to content

Custom Radio

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

Usage

vue

<template>
  <ERadioCustom
      :contents="radioContents"
      v-model="selectedValue"
  />
</template>

<script setup>
  const radioContents = ref([
    {
      title: "Graphic design",
      value: "g-design",  // if not defined, the index of item will be used.
    },
    {
      title: "Web design",
      value: "d-design",  // if not defined, the index of item will be used.
    },
  ]);
  const selectedValue = ref();
</script>

NOTE

To display the ‍ERadioCustom‍ element, the title property must be present. All other attributes are optional.

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

Props

For ERadioCustom component, the following props are available:

PropTypeDefaultNote
contentsArray-Radio content.
labelString-Component's label
actionButtonBooleanfalseDisplays the radio button.
modelValue[Number, String]-Active state.
widthString-Sets the component's width.
heightString-Sets the component's height.
verticalBooleanfalseIt organizes your radio vertically.
disabledBooleanfalseDisables the ERadioCustom content.
tickBadgeBooleanfalseDisplays a tick mark if the state if true.
validateOnString"input"Triggers validation on @values: submit, input.
nameString-HTML name attribute..
growBooleanfalseMakes the radio expand to fit the full container width.
wrapperClassesString-Overrides or extends the radio wrappers styles.
rulesArray-Validation rules. For more info refer to Form Validation.
sizeString"md"The ERadioCustom element has three predefined sizes: sm, md, lg.
alignString"start"Specifies how the radio buttons are distributed along the cross axis in a container.
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.
squareBooleanfalseRemoves rounded corners of the element.

Emits

The ERadioCustom component contains following emits.

EmitDescription
update:modelValueControls the modelValue of the element.

COPYRIGHT