Installation
Usage
<script lang="ts">
import { Textarea } from "$lib/components/ui/textarea/index.js";
</script>
<Textarea /> Field Integration
Shards UI does not provide a native Textarea part. This component wraps the native <textarea> element in Field.Control internally, so it integrates with Field without another wrapper.
<Field.Root>
<Field.Label>Bio</Field.Label>
<Textarea placeholder="Tell us about yourself…" />
<Field.Description>Write a short bio.</Field.Description>
<Field.Error>This field is required.</Field.Error>
</Field.Root> API Reference
Textarea
Styled native textarea element with custom size options.
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" \| "default" \| "lg" \| number | "default" | Controls the textarea padding. Numeric values retain the default padding; use the native rows prop for a row count |
unstyled | boolean | false | Removes the outer control styling while retaining the inner textarea styles |