Skip to content

co-input

This content is not available in your language yet.

Text input field with label, helper text, icons, and clear functionality. Supports vertical and horizontal label layouts, action button, and chips.

Ver código
<co-input label="Email" placeholder="tu@email.com" icon-left="envelope"></co-input>

Props

PropAtributoTipoDefaultDescripción
actionIconaction-iconstring | undefinedPhosphor icon name for the integrated action button
actionLabelaction-labelstring | undefinedLabel for the integrated action button (Botón variant)
autocompleteautocompletestring | undefinedAutocomplete hint for the browser
clearableclearablebooleanfalseShow clear button when input has value
disableddisabledbooleanfalseDisabled state
helperTexthelper-textstring | undefinedHelper text displayed below the input
iconLefticon-leftstring | undefinedPhosphor icon name for the left position
iconRighticon-rightstring | undefinedPhosphor icon name for the right position
labellabelstring | undefinedLabel text displayed above or beside the input
layoutlayout"horizontal" | "vertical"'vertical'Label layout: vertical (label above) or horizontal (label beside)
namenamestring | undefinedInput name attribute
placeholderplaceholderstring'Placeholder'Placeholder text
readonlyreadonlybooleanfalseRead-only state
requiredrequiredbooleanfalseWhether the field is required
secondaryLabelsecondary-labelstring | undefinedSecondary label displayed on the right side
statusstatus"default" | "error" | "info" | "success" | "warning"'default'Validation status
typetypestring'text'HTML input type
valuevaluestring''Current value

Eventos

EventoDetailBubblesCancelableDescripción
coActionvoidEmitted when the integrated action button is clicked
coBlurvoidEmitted on blur
coChangestringEmitted when the input loses focus
coClearvoidEmitted when the clear button is clicked
coFocusvoidEmitted on focus
coInputstringEmitted when the input value changes (on input)

Slots

SlotDescripción
(default)Default slot for custom content inside the field
actionSlot for action button, rendered flush-right inside the field (Botón variant)
chipsSlot for chip/tag elements rendered before the input (Chips variant)
suffixSlot for suffix content (e.g. toggle password icon) rendered after the input

CSS Parts

PartDescripción
::part(action)
::part(clear)
::part(field)
::part(helper)
::part(input)
::part(label)
::part(secondary-label)
::part(wrapper)

CSS Custom Properties

Este componente no expone CSS custom properties.