Installation
pnpm dlx shadcn-svelte@latest add https://coss-sv.vercel.app/r/textarea.jsonUsage
<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. Number values pass to the native rows attribute |
unstyled | boolean | false | Removes all default styling |