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

CataUiInputColor

A color input component that provides a dropdown color selector with customizable options.

Color input
Color input
<CataUiInputColor label="Color input" :options="options" v-model="myValue" />
<CataUiInputColor tooltip="Helpful tooltip" label="Required color" :options="options" required v-model="myValue" />
<CataUiInputColor label="Disabled color" :options="options" disabled v-model="myValue" />
<CataUiInputColor label="With error" error="Invalid color selection" :options="options" v-model="myValue" />
<CataUiInputColor label="Loading state" :options="options" :loading="true" v-model="myValue" />

Props

PropDescriptionTypeDefaultRequiredOptions
disabledDisables the inputBooleanfalsefalse
errorDisplays the string as an error messageString''false
labelThe text label displayed above the inputString''false
loadingShows a loading spinner when trueBooleanfalsefalse
optionsAn array of color options for the dropdownArraytrue
requiredDisplays a required indicator (*)Booleanfalsefalse
tooltipTooltip text displayed on hoverString''false
v-modelSelected color valueStringnulltrue

Events

EventDescriptionParameters
update:modelValueEmitted when the selected color changesString (new color value)

Slots

SlotDescription
actionsCustom content for the input's action area (inherited from CataUiInput)

Data structure

// Selected color value
const myValue = ref('');

// Color options array
const options = [
    {
        value: '#fff', // Color value (hex code)
        label: 'White' // Display name for the color
    },
    {
        value: '#000',
        label: 'Black'
    },
    {
        value: '#f00',
        label: 'Red'
    },
    {
        value: '#ff0',
        label: 'Yellow'
    }
]

Usage Notes

  • The component displays color swatches next to the color names in the dropdown
  • Selecting a color will show a colored square in the input
  • The component supports both direct text input and selection from dropdown
  • Each option should have a value (hex code) and a label (display name)
  • Hex code values will show a colored square preview
Prev
CataUiInputCheckbox
Next
CataUiInputDate