<script lang="ts">
import { Textarea } from "$lib/components/ui/textarea/index.js";
</script>
<Textarea placeholder="Type your message here." /> Installation
pnpm dlx jsrepo@latest add textareanpx jsrepo@latest add textareayarn dlx jsrepo@latest add textareabunx jsrepo@latest add textareaCopy and paste the following code into your project.
import Root from './textarea.svelte';
export {
Root,
//
Root as Textarea
};
Usage
<script lang="ts">
import { Textarea } from '$lib/components/ui/textarea/index.js';
</script> <Textarea /> Examples
Default
<script lang="ts">
import { Textarea } from "$lib/components/ui/textarea/index.js";
</script>
<Textarea placeholder="Type your message here." /> Disabled
<script lang="ts">
import { Textarea } from "$lib/components/ui/textarea/index.js";
</script>
<Textarea disabled placeholder="Type your message here." /> With Label
<script lang="ts">
import { Label } from "$lib/components/ui/label/index.js";
import { Textarea } from "$lib/components/ui/textarea/index.js";
</script>
<div class="grid w-full gap-1.5">
<Label for="message">Your message</Label>
<Textarea placeholder="Type your message here." id="message" />
</div> With Text
Your message will be copied to the support team.
<script lang="ts">
import { Label } from "$lib/components/ui/label/index.js";
import { Textarea } from "$lib/components/ui/textarea/index.js";
</script>
<div class="grid w-full gap-1.5">
<Label for="message-2">Your Message</Label>
<Textarea placeholder="Type your message here." id="message-2" />
<p class="text-muted-foreground text-sm">
Your message will be copied to the support team.
</p>
</div> With Button
<script lang="ts">
import { Button } from "$lib/components/ui/button/index.js";
import { Textarea } from "$lib/components/ui/textarea/index.js";
</script>
<div class="grid w-full gap-2">
<Textarea placeholder="Type your message here." />
<Button>Send message</Button>
</div>