UI LibraryUI Library
Guide
Components
Styling
Repo
Guide
Components
Styling
Repo
  • Guide

    • Introduction
    • Getting Started
  • Components

    • CataUiAccordion
    • CataUiAccordionItem
    • CataUiAlert
    • CataUiAnchorMenu
    • CataUiBadge
    • CataUiButton
    • CataUiCollapse
    • CataUiDraggable
    • CataUiDropdown
    • CataUiDropover
    • CataUiFileTree
    • CataUiIcon
    • CataUiIconSwitch
    • CataUiInput
    • CataUiInputCheckbox
    • CataUiInputColor
    • CataUiInputDate
    • CataUiInputGroup
    • CataUiInputRadio
    • CataUiInputSearch
    • CataUiInputSelect
    • CataUiMasonry
    • CataUiMasonryTile
    • CataUiLogo
    • CataUiModal
    • CataUiPaginate
    • CataUiProgress
    • CataUiSpinner
    • CataUiStatusLabel
    • CataUiSwitch
    • CataUiTable
    • CataUiTableAG
    • CataUiTableFooter
    • CataUiTabs
    • CataUiTabSwitch
    • CataUiTooltip
  • Styling

    • Colors
    • Icons
    • Typography
    • Utils

CataUiInputGroup

A component that manages a group of related input elements (checkboxes or radio buttons) with shared properties such as labels, error handling, and tooltips.

Radio Group (with required field)
Radio Group with Error
Please select a valid option
Disabled Radio Group
Checkbox Group
Checkbox Group with Error
Please select at least one option
Disabled Checkbox Group
<CataUiInputGroup 
  :disabled="false"
  :error="errorMessage" 
  label="Select your preferences" 
  :options="options" 
  :required="true"
  tooltip="Choose one or more options"
  type="checkbox" 
  v-model="selectedValues" />

<CataUiInputGroup 
  :disabled="false"
  :error="errorMessage" 
  label="Select your option" 
  :options="radioOptions" 
  :required="true"
  tooltip="Choose only one option"
  type="radio" 
  v-model="selectedValue" />

Props

PropDescriptionTypeDefaultRequiredOptions
disabledDisables all inputs in the groupBooleanfalsefalse
errorDisplays the string as an error message below the groupString''false
labelThe headline text displayed above the group of inputsString''false
optionsArray of options to be displayed in the group (see structure below)Arraytrue
requiredDisplays a required indicator (*) next to the labelBooleanfalsefalse
tooltipText displayed in a tooltip next to the group labelString''false
typeType of input elements to be used in the groupString'checkbox'false'checkbox', 'radio'

Model Value

The component uses Vue 3's defineModel to support v-model binding:

  • When type="checkbox": The model value should be an array that stores the selected values.
  • When type="radio": The model value should be a string, number, or boolean matching the selected option's value.

Options Structure

The options prop requires an array of objects with the following structure:

const options = [
    {
        value: 'opt1',  // String, Number, or Boolean - the value to be stored in v-model when selected
        label: 'Option 1'  // String - the text label displayed next to the input
    },
    {
        value: 'opt2',
        label: 'Option 2'
    },
    {
        value: 'opt3',
        label: 'Option 3'
    }
]

Examples

Radio Group Example

<template>
  <CataUiInputGroup
    label="Select your favorite fruit"
    type="radio"
    :options="fruitOptions"
    v-model="selectedFruit"
    :required="true"
    :error="fruitError"
    tooltip="Choose only one option" />
</template>

<script setup>
import { ref } from 'vue';

const selectedFruit = ref('');
const fruitError = ref('');

const fruitOptions = [
  { value: 'apple', label: 'Apple' },
  { value: 'banana', label: 'Banana' },
  { value: 'orange', label: 'Orange' }
];

const validateSelection = () => {
  if (!selectedFruit.value) {
    fruitError.value = 'Please select a fruit';
  } else {
    fruitError.value = '';
  }
};
</script>

Checkbox Group Example

<template>
  <CataUiInputGroup
    label="Select your hobbies"
    type="checkbox"
    :options="hobbyOptions"
    v-model="selectedHobbies"
    tooltip="Select all that apply" />
</template>

<script setup>
import { ref } from 'vue';

const selectedHobbies = ref([]);
const hobbyOptions = [
  { value: 'reading', label: 'Reading' },
  { value: 'sports', label: 'Sports' },
  { value: 'music', label: 'Music' },
  { value: 'cooking', label: 'Cooking' }
];
</script>
Prev
CataUiInputDate
Next
CataUiInputRadio