Command palette

@yasinsensoy/web

Web · Components

Textarea

Multi-line text input.

2 exports

Live example

Preview

Code

import { Textarea } from "@yasinsensoy/web";

<Textarea autoResize placeholder="Grows as you type" />

Events

  1. Events appear here when you interact with the preview.

Import

import { Textarea } from "@yasinsensoy/web";

Textarea

componentClient component

Multi-line text input. Supports all native <textarea> props. When the content overflows it uses a scrollbar that takes no width and appears only while scrolling (see ScrollArea).

Textarea({ className, containerClassName, autoResize, variant, effect, ref, ...props }: TextareaProps): JSX.Element

Examples

<Textarea placeholder="Your message" rows={4} />
<Textarea autoResize className="max-h-60" />

TextareaProps

interface

Props of the Textarea component.

Extends: ComponentProps<"textarea">

NameTypeDefaultDescription
autoResize?booleanfalseIf true, the height grows with the content automatically. Uses no JavaScript; works with CSS field-sizing: content. In unsupporting browsers it falls back to a normal (manually resized) field. For an upper limit pass a max-h-* class.
containerClassName?stringClasses of the container wrapping the field. The container carries the scrollbar; put layout classes here if needed (e.g. flex-1, w-64).
variant?FieldVariant | CustomVariant<"field">Look: outline (bordered), filled, underline or ghost (plain). If omitted, the setting of the nearest data-field-variant container is used, otherwise outline. See FieldVariant.
effect?EffectPropEffect or effects of the field box (e.g. "glow", ["lift", "beam"]). The accent color is the focus color (--ui-field-focus). If omitted, UIProvider appearance.defaults.field.effect. See BuiltinEffect.