Skip to content

co-textarea

This content is not available in your language yet.

Entrada de texto multilínea que replica el estilo de co-input sobre un <textarea> nativo. Úsalo para contenido largo como biografías, descripciones o notas. Admite layout vertical u horizontal, contador con max-length y estados de validación.

Ver código
<co-textarea label="Notas" placeholder="Escribe una nota…" rows="4" helper-text="Añade el contexto relevante" clearable></co-textarea>

Props

PropAtributoTipoDefaultDescripción
clearableclearablebooleanfalseShow clear button when textarea has value
disableddisabledbooleanfalseDisabled state
helperTexthelper-textstring | undefinedHelper text displayed below the textarea
labellabelstring | undefinedLabel text displayed above the textarea
layoutlayout"horizontal" | "vertical"'vertical'Label layout: vertical (label above) or horizontal (label beside)
maxLengthmax-lengthnumber | undefinedMaximum character length. When set, a counter is displayed.
namenamestring | undefinedInput name attribute
placeholderplaceholderstring''Placeholder text
readonlyreadonlybooleanfalseRead-only state
requiredrequiredbooleanfalseWhether the field is required
resizeresize"both" | "none" | "vertical"'vertical'Resize behavior of the textarea
rowsrowsnumber4Number of visible text rows
secondaryLabelsecondary-labelstring | undefinedSecondary label displayed on the right side
sizesize"lg" | "md" | "s" | "sm"'md'Field size (mirrors co-input paddings/font: s / sm / md / lg). Vertical extent still comes from `rows`.
statusstatus"default" | "error" | "success" | "warning"'default'Validation status
valuevaluestring''Current value

Eventos

EventoDetailBubblesCancelableDescripción
coBlurvoidEmitted on blur
coChangestringEmitted with the committed text on blur
coClearvoidEmitted when clear button is clicked
coFocusvoidEmitted on focus
coInputstringEmitted on every keystroke with the current text

Slots

Este componente no expone slots.

CSS Parts

PartDescripción
::part(counter)The character counter element
::part(field)The bordered textarea wrapper
::part(helper)The helper/error text row
::part(input)The native textarea element
::part(label)The field label
::part(wrapper)Root container

CSS Custom Properties

Este componente no expone CSS custom properties.