Files
Memento/src/lib/components/ui/textarea/textarea.svelte
2026-02-17 12:35:46 +13:00

29 lines
909 B
Svelte

<script lang="ts" module>
import { cn, type WithElementRef } from "$lib/utils.js";
import type { HTMLTextareaAttributes } from "svelte/elements";
export type TextareaProps = WithElementRef<HTMLTextareaAttributes> & {
class?: string;
value?: string;
};
</script>
<script lang="ts">
let {
class: className,
value = $bindable(""),
ref = $bindable(null),
...restProps
}: TextareaProps = $props();
</script>
<textarea
bind:this={ref}
bind:value
class={cn(
"flex min-h-20 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
className,
)}
{...restProps}
></textarea>