---
id: portfolio.ds.chat-text-input
name: "Chat Text Input"
type: component
status: active
relations: [{"type":"supersedes","target":"portfolio.ds.chat-text-input-old"},{"type":"uses_token","target":"portfolio.ds.focus-interaction-states"},{"type":"uses_token","target":"portfolio.ds.typography"}]
sources: ["packages/design-system/src/components/ChatTextInput.astro","apps/portfolio-site/src/design-system/docs/chat-text-input.astro","apps/portfolio-site/src/lib/designSystemRegistry.ts"]
catalog: ["apps/portfolio-site/src/design-system/docs/chat-text-input.astro"]
previews: ["apps/portfolio-site/src/design-system/docs/chat-text-input.astro"]
---
# Chat Text Input

## Purpose
The private multiline text field owned by Chat Composer.

## Contract
- Chat Text Input is private to Chat Composer and must not be used directly by pages or other product components. Its isolated Design System Preview is allowed for documentation and review, not as a separate product use.
- In the Design System menu, the entry is nested under Chat Composer below the separator. Its canonical URL remains flat and independent from menu ancestry.
- Chat Composer owns the field's placement and surrounding spacing. Chat Text Input owns the native textarea, content sizing, placeholder, accessible name and input states. The Chat controller owns submission, cancellation and the pending lifecycle.
- Uses Body typography through `--font-sans`, `--font-size-body`, `--font-weight-regular` and `--line-height-body`.
- Text and caret use `--color-text`; placeholder uses `--color-secondary-text` directly. The transparent background uses `--interaction-alt-normal-bg`; disabled uses `--interaction-disabled-opacity`. No local color mixing, transitions or animations.
- Native textarea with label, placeholder, disabled, readOnly and maxLength props. Optional describedBy associates visible copy with the field. Uses the shared Chat default `Have questions? Ask away.`, with a one-line minimum on Mobile and a two-line minimum on Tablet, Desktop and Ultra-wide, content-driven growth and a ten-line maximum in a normal viewport. The component owns these breakpoint rules in both the site and Design System Preview.
- With the Homepage soft keyboard open, the available height caps draft growth and may reduce the minimum to one line in a short viewport. Longer drafts scroll inside the textarea instead of hiding the Send or Stop control.
- Beyond the available height this child owns vertical scrolling. No border, shadow, internal padding, margin, manual resize handle or hover background change.
- Owner-approved caret-only focus exception: focus, focus-visible and pressed have no outline or focus ring. Native editing, accessible label, maxlength and fieldset disabling stay intact. The textarea intentionally omits native `required` validation so the browser does not produce a validation tooltip; Chat prevents empty submission through its control and controller logic. `maxLength` defaults to 2000; Composer supplies `readOnly` while a response is pending.
- The standalone Preview and consuming chat use the same current placeholder default and input states. Parent previews must not invent product copy or override child-owned layout and states.
- Preview exposes `Content: empty / filled` separately from interaction `State`. Empty clears the value; filled keeps existing text or inserts an abstract sample. Typing or clearing text updates the Content selection, while State changes preserve the draft. Content is a preview fixture, not a runtime input prop.

## Use
- Use inside Chat Composer or its isolated Design System Preview.
- The Preview operates locally without requests to an answer provider.

## Do Not Use
- Do not consume this private child directly outside Chat Composer, use it as a single-line search field, or add request/provider logic to it.
- Do not override child-owned visuals from a parent or create local replacements for shared tokens.

## Accessibility
- Preserve native textarea semantics, accessible names, keyboard behavior and disabled/read-only states. Placeholder is a hint, not a substitute for the accessible name.
- Caret-only focus is an owner-approved visual exception, not a verified WCAG focus-indicator audit.
- Physical mobile keyboard and assistive-technology behavior still require separate review.

## Verification
- Check all four Preview contexts, available state controls, wrapping and geometry.
- Check empty/filled content, typing, clear/reset, wrapping, content-driven growth and scrolling beyond the available height.
- Check native focus, disabled inheritance, read-only text selection, maxlength behavior, absence of native required validation and composition inside Chat Composer.
- Validate canonical routes, imports and Essence graph references without duplicate Preview initialization.

## Enabled Profile Records
- Registry ID: chat-text-input.
- Canonical route: /design-system/chat-text-input/. No legacy route or redirect is retained.
- Media: no new source or delivery assets.
