Skip to content
Kimenpre-v1
Color scheme

Component

ki-textarea

A token-styled multiline text field with native form semantics — comments, descriptions, messages, delivery notes.

<ki-textarea label="Delivery notes" name="notes" rows="3" placeholder="Gate code, preferred entrance…"></ki-textarea>
Send
<form onsubmit="event.preventDefault()">
<ki-textarea label="Feedback" name="feedback" required rows="4"></ki-textarea>
<ki-button variant="primary">Send</ki-button>
</form>

Initial text is declared through the value attribute; element text content is ignored:

<ki-textarea label="Bio" value="Design systems, gates, and coffee."></ki-textarea>

When to use: free-form text longer than one line, such as comments, descriptions, messages, delivery notes, or addresses when paired with a matching autocomplete purpose.

When not to use: single-line values (ki-input), constrained choices, rich or formatted text editing, or search boxes. Agent note: initial text is declared through the value attribute; element text content is ignored. Enter inserts a line break and never submits the enclosing form, the inverse of ki-input.

Properties & attributes

AttributePropertyTypeDefaultDescription
autocompleteautocompletestring | undefinedAutofill detail token forwarded to the native textarea. When to use: expose entry purpose such as street-address when available. When NOT to use: omit when no valid autofill purpose applies.
disableddisabledbooleanfalseDisables editing, focus, validation and form-data contribution. When to use: make a field temporarily unavailable. When NOT to use: do not use disabled for readonly review text that should submit.
labellabelstringVisible label rendered by the component and used as the accessible name. When to use: always provide a concise label for the requested long-form text. When NOT to use: do not substitute placeholder text for the label.
namenamestring | undefinedForm-data key used when the textarea submits with a form. When to use: provide for fields whose text must be included in FormData. When NOT to use: omit for display-only or client-only fields.
placeholderplaceholderstring | undefinedHint shown while the textarea is empty. When to use: add an example or short formatting hint. When NOT to use: do not use placeholder as the accessible name or required instruction.
readonlyreadonlybooleanfalseMakes the textarea focusable and selectable while rejecting edits. When to use: show submitted or policy text that should still be included in form data. When NOT to use: do not use readonly to remove a field from submission; use disabled.
requiredrequiredbooleanfalseRequires a non-empty value before form submission. When to use: mark mandatory long-form text. When NOT to use: do not pair with readonly expecting it to block; readonly fields are validation exempt like native textareas.
rowsrowsnumber2Visible line count. Invalid, non-numeric, zero, or negative values fall back to 2; no auto-grow or user resize handle exists in v1. When to use: set the stable multiline height needed by the layout. When NOT to use: do not use rows as a responsive size axis.
valuevaluestring''Live current text. The value attribute declares the reset default; element text content is ignored. Programmatic assignments replace the display and emit no events. When to use: preload or read free-form text, line breaks included. When NOT to use: do not put initial text between the element tags.

CSS parts

PartDescription
fieldThe enclosure wrapper.
labelRendered visible label and accessible-name source.
textareaInternal native multiline control.

CSS custom properties

The public styling contract of ki-textarea: reassign these tokens at :root or on a subtree — never override internals.

TokenDescription
--ki-motion-duration-fastFast interaction transition duration.
--ki-motion-easing-outDecelerating interaction transition easing curve.
--ki-textarea-border-block-end-widthdimension used by the textarea component for border block end width.
--ki-textarea-border-block-start-widthdimension used by the textarea component for border block start width.
--ki-textarea-border-inline-end-widthdimension used by the textarea component for border inline end width.
--ki-textarea-border-inline-start-widthdimension used by the textarea component for border inline start width.
--ki-textarea-disabled-bgcolor used by the textarea component for disabled background (MarsUI Surface/disabled_base_em Gray/100; aligned with ki-input).
--ki-textarea-disabled-bordercolor used by the textarea component for disabled border.
--ki-textarea-disabled-fgcolor used by the textarea component for disabled foreground.
--ki-textarea-disabled-label-fgcolor used by the textarea component for disabled label foreground.
--ki-textarea-disabled-placeholder-fgcolor used by the textarea component for disabled placeholder foreground.
--ki-textarea-focus-bgcolor used by the textarea component for focus background (MarsUI active fill switches to white / dark s2 — modeled with the scheme ladder s0).
--ki-textarea-focus-fgcolor used by the textarea component for focus foreground.
--ki-textarea-focus-label-fgcolor used by the textarea component for focus label foreground (MarsUI label is Text/med_em in every non-disabled state; matches ki-input).
--ki-textarea-focus-placeholder-fgcolor used by the textarea component for focus placeholder foreground (MarsUI placeholder Text/low_em; placeholder is not the accessible name, so it sits outside the 4.5:1 text sweep).
--ki-textarea-focus-ring-colorcolor used by the textarea component for focus ring color.
--ki-textarea-focus-ring-offsetdimension used by the textarea component for focus ring offset.
--ki-textarea-focus-ring-shadowshadow used by the textarea component for the focus ring glow (MarsUI Focus/primary: 3px spread ring at 20% — see ki.focus.primary. specs/002-ki-button/design-extraction.md §2.5 recorded 40%, having read the alpha off the Dark canvas mode, same double mechanism as ki-button: glow plus the opaque indicator).
--ki-textarea-focus-ring-widthdimension used by the textarea component for focus ring width.
--ki-textarea-font-sizedimension used by the textarea component for font size.
--ki-textarea-font-weightfont weight used by the textarea component for font weight.
--ki-textarea-hover-bgcolor used by the textarea component for hover background (MarsUI hover = s2 + Black/3 overlay; s3 is the nearest token).
--ki-textarea-hover-bordercolor used by the textarea component for hover border.
--ki-textarea-hover-fgcolor used by the textarea component for hover foreground.
--ki-textarea-hover-label-fgcolor used by the textarea component for hover label foreground (MarsUI label is Text/med_em in every non-disabled state; matches ki-input).
--ki-textarea-hover-placeholder-fgcolor used by the textarea component for hover placeholder foreground (MarsUI placeholder Text/low_em; placeholder is not the accessible name, so it sits outside the 4.5:1 text sweep).
--ki-textarea-invalid-bgcolor used by the textarea component for invalid background (MarsUI danger keeps the white active fill — no tinted slab; ring and hint carry the signal).
--ki-textarea-invalid-bordercolor used by the textarea component for invalid border.
--ki-textarea-invalid-fgcolor used by the textarea component for invalid foreground.
--ki-textarea-invalid-label-fgcolor used by the textarea component for invalid label foreground (MarsUI label is Text/med_em in every non-disabled state; matches ki-input).
--ki-textarea-invalid-placeholder-fgcolor used by the textarea component for invalid placeholder foreground (MarsUI placeholder Text/low_em; placeholder is not the accessible name, so it sits outside the 4.5:1 text sweep).
--ki-textarea-invalid-ringshadow used by the textarea component for the persistent invalid ring (MarsUI Focus/danger: 3px danger-500 alpha spread; applied as box-shadow while :state(user-invalid)).
--ki-textarea-label-font-sizedimension used by the textarea component for label font size (MarsUI UI/Para/medium: body_1 13px).
--ki-textarea-label-font-weightfont weight used by the textarea component for label font weight.
--ki-textarea-label-gapdimension used by the textarea component for label gap.
--ki-textarea-label-line-heightdimension used by the textarea component for label line height (MarsUI line_height/para 20px).
--ki-textarea-label-padding-inlinedimension used by the textarea component for label padding inline (MarsUI Input_label row 2px inset aligning the label ink with the cell radius; matches ki-input).
--ki-textarea-line-heightdimension used by the textarea component for line height.
--ki-textarea-min-targetdimension used by the textarea component for min target.
--ki-textarea-padding-blockdimension used by the textarea component for padding block (MarsUI 96px md textarea: 12px ink inset).
--ki-textarea-padding-inlinedimension used by the textarea component for padding inline (MarsUI 96px md textarea: 12px ink inset).
--ki-textarea-radiusdimension used by the textarea component for radius (MarsUI Radius/component/radius_md 10px for the md size; component ramp so personality modes reach it).
--ki-textarea-readonly-bgcolor used by the textarea component for readonly background.
--ki-textarea-readonly-bordercolor used by the textarea component for readonly border.
--ki-textarea-readonly-fgcolor used by the textarea component for readonly foreground.
--ki-textarea-readonly-label-fgcolor used by the textarea component for readonly label foreground (MarsUI label is Text/med_em in every non-disabled state; matches ki-input).
--ki-textarea-readonly-placeholder-fgcolor used by the textarea component for readonly placeholder foreground (MarsUI placeholder Text/low_em; placeholder is not the accessible name, so it sits outside the 4.5:1 text sweep).
--ki-textarea-rest-bgcolor used by the textarea component for rest background (MarsUI textarea fill Surface/s2).
--ki-textarea-rest-bordercolor used by the textarea component for rest border.
--ki-textarea-rest-fgcolor used by the textarea component for rest foreground.
--ki-textarea-rest-label-fgcolor used by the textarea component for rest label foreground (MarsUI label is Text/med_em in every non-disabled state; matches ki-input).
--ki-textarea-rest-placeholder-fgcolor used by the textarea component for rest placeholder foreground (MarsUI placeholder Text/low_em; placeholder is not the accessible name, so it sits outside the 4.5:1 text sweep).
--ki-typography-family-bodysemantic font family for typography family body.

The label prop is the accessible name — mandatory, and placeholder is never a substitute. Enter inserts a line break and never submits the enclosing form — the inverse of ki-input. For single-line values use ki-input; rich or formatted editing is out of scope.

Open ki-textarea in Storybook