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

CataUiInput

A versatile input component that supports both text input and textarea, with customizable features such as labels, icons, tooltips, and action buttons.

My input label
My input label
Textarea
<!-- Basic text input with label -->
<CataUiInput type="text" label="My input label" v-model="myValue"></CataUiInput>

<!-- Required input with tooltip -->
<CataUiInput 
  required 
  type="text" 
  label="My input label" 
  tooltip="Lorem ipsum dolor sit amet, viris partiendo mel et, pro minim oratio fierent ex." 
  v-model="myValue">
</CataUiInput>

<!-- Input with icon -->
<CataUiInput 
  type="text" 
  icon="bi-search" 
  iconAlignment="left"
  placeholder="Search" 
  v-model="myValue2" />

<!-- Textarea with error message -->
<CataUiInput 
  label="Textarea" 
  error="This field has an error"
  placeholder="Enter your text here" 
  :textArea="true" 
  v-model="myValue3">
</CataUiInput>

<!-- Input with actions slot -->
<CataUiInput 
  type="text" 
  label="Input with actions" 
  v-model="myValue4">
  <template #actions>
    <CataUiButton icon="bi-x"></CataUiButton>
  </template>
</CataUiInput>

Tips

The input component works exactly like a normal <input /> element. You can add standard HTML input attributes like type (e.g., text, number, password, email), placeholder, disabled, etc.

The component can be enhanced with tooltips and action buttons using the appropriate slots and props.

Warning

For checkbox and radio inputs, please use the dedicated CataUiInputCheckbox and CataUiInputRadio components instead.

Props

PropDescriptionTypeDefaultRequiredOptions
errorDisplays an error message below the input fieldString''false
iconIcon name to display within the input fieldString''false
iconAlignmentSets the alignment of the icon within the input fieldString'left'false'left', 'right'
labelThe text label displayed above the inputString''false
requiredShows a required indicator (*) next to the labelBooleanfalsefalse
textAreaWhen true, renders the input as a textareaBooleanfalsefalse
tooltipText to display in a tooltip next to the labelString''false

Events

EventDescriptionParameters
update:modelValueEmitted when the input value changesThe new input value

Slots

SlotDescription
actionsUsed for adding action buttons to the input or textarea. Position varies based on the textArea prop
input-messageSlot for adding custom messages below the input field (after the error message if present)
Prev
CataUiIconSwitch
Next
CataUiInputCheckbox