shadimage

Textarea

An input that can increase in height to accommodate more text.

registry/new-york/blocks/textarea/textarea.tsx

import * as React from "react";

import { cn } from "@/lib/utils";

function Textarea({
  className,
  showHandle = true,
  ...props
}: React.ComponentProps<"textarea"> & { showHandle?: boolean }) {
  return (
    <textarea
      data-slot="textarea"
      className={cn(
        "border-input placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-primary/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent p-3 text-base shadow-md shadow-shade transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
        showHandle ? "resize-y" : "resize-none",
        "hover:shadow-none hover:bg-foreground/5 hover:border-border/0 transition-all duration-150 ease-out hover:duration-75",
        className
      )}
      {...props}
    />
  );
}

export { Textarea };

No selection tags yet — empty means no evidence, not lack of support.