GitHubGitHub
← All components
Forms / component

Textarea

A textarea with optional auto-grow and the same states as TextInput.

DefaultAuto-growInvalid
<Textarea bind:value autoGrow placeholder="Add context…" />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { Textarea } from '@chanrg/4ui';<Textarea bind:value autoGrow placeholder="Add context…" />

API reference

Props

PropTypeDefaultDescription
valuestring ($bindable)''Content.
rowsnumber3Initial rows.
autoGrowbooleanfalseGrow with content instead of scrolling.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Composes with Field; keeps native resize unless autoGrow.

Dependencies

No runtime component dependencies.