Install
Pull Textarea from the barrel for everyday use, or the granular path when you want a tighter bundle.
import { Textarea } from "@brika/clay";import { Textarea } from "@brika/clay/components/textarea";A minimal example
Drop this into a page. Native HTML attributes pass through to the underlying primitive.
'use client';
import { Textarea } from '@brika/clay/components/textarea';
/** Multi-line text input in its default auto-sizing state. */
export default function TextareaDefaultDemo() {
return (
<div className="w-full max-w-sm">
<Textarea placeholder="Tell us about your project…" />
</div>
);
}Textarea, every way
Accessibility
- Always associate with a
<Label>via matchingid/htmlFor. -
aria-invalid="true"triggers the destructive ring; pair with a visible error message viaaria-describedby. - Disabled textareas are removed from the tab order, use
readOnlywhen content must stay focusable. - Character count readouts should be linked via
aria-describedbyso AT announces remaining characters.
Theme tokens
Every CSS variable Textarea reads, with its default and the
dotted path you'd write in a ThemeConfig JSON
to override it. Set any of these in your theme to retune Textarea
without touching component code.
Textarea tokens
20 tokens--textarea-containercolorvar(--input-container)components.textarea.containerBackground color of the textarea. Inherits the standalone Input container so themes that retune `--input-container` retune the textarea automatically.
--textarea-labelcolorvar(--input-label)components.textarea.labelForeground color of the text typed into the textarea. Mirrors `--input-label`.
--textarea-bordercolorvar(--input-border)components.textarea.borderResting border color of the textarea. Mirrors `--input-border`.
--textarea-placeholdercolorvar(--input-placeholder)components.textarea.placeholderForeground color of the textarea placeholder. Mirrors `--input-placeholder`.
--textarea-invalid-bordercolorvar(--destructive)components.textarea.invalidBorderBorder color drawn when the textarea is in an invalid state (`aria-invalid=true`).
--textarea-radiusradiusvar(--radius-control)components.textarea.radiusTextarea corner radius.
--textarea-padding-xsizecalc(var(--spacing) * 3)components.textarea.paddingXInline padding inside the textarea.
--textarea-padding-ysizecalc(var(--spacing) * 2)components.textarea.paddingYBlock padding inside the textarea.
--textarea-gapsizecalc(var(--spacing) * 2)components.textarea.gapGap between adjacent children inside the textarea.
--textarea-border-widthborder-width1pxcomponents.textarea.borderWidthBorder width on the textarea. Set non-zero for outline-style variants.
--textarea-border-styleborder-stylesolidcomponents.textarea.borderStyleBorder style on the textarea (`solid`, `dashed`, `double`, `none`).
--textarea-font-familyfont-familyvar(--font-sans)components.textarea.fontFamilyTypeface for textarea.
--textarea-font-sizefont-sizevar(--text-body-md)components.textarea.fontSizeFont size for textarea.
--textarea-font-weightfont-weight500components.textarea.fontWeightFont weight for textarea.
--textarea-line-heightline-height1.25components.textarea.lineHeightLine height for textarea.
--textarea-letter-spacingletter-spacing0components.textarea.letterSpacingLetter spacing for textarea. Useful for caps labels.
--textarea-text-transformtext-transformnonecomponents.textarea.textTransformText transform for textarea (`uppercase`, `lowercase`, `capitalize`, `none`).
--textarea-backdrop-blurblur0pxcomponents.textarea.backdropBlurBackdrop blur applied to the textarea surface. Set non-zero for a frosted-glass treatment.
--textarea-durationdurationvar(--motion-standard-duration)components.textarea.durationTransition duration for textarea state changes.
--textarea-easingeasingvar(--motion-standard-easing)components.textarea.easingTransition easing for textarea state changes.
Override in a theme
Authoring a theme is plain JSON. Drop overrides under
components.textarea, the names
are camelCase versions of the variable suffix.
{
"id": "my-theme",
"name": "My Theme",
"description": "...",
"accentSwatches": ["#000"],
"components": {
"textarea": {
"paddingX": "calc(var(--spacing) * 3)"
}
}
}
Then apply with applyTheme(myTheme)
(see the theming guide),
scope it to a subtree with themeToCssVars(myTheme, mode),
or consume any token directly in your own JSX with the matching Tailwind utility
(e.g. bg-textarea-…) — see the
chips on each token row.
API reference
Props specific to Textarea. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.
No wrapper-specific props, all attributes pass through to the underlying primitive.