Components
Loading preview...
Enhanced shadcn/ui textarea
npx shadcn@latest add https://21st.dev/r/originui/textareaimport { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
import { useId } from "react";
function Component() {
const id = useId();
return (
<div className="space-y-2 min-w-[300px]">
<Label htmlFor={id}>Textarea with error</Label>
<Textarea
id={id}
className="border-destructive/80 text-destructive focus-visible:border-destructive/80 focus-visible:ring-destructive/20"
placeholder="Leave a comment"
defaultValue="Hello!"
/>
<p className="mt-2 text-xs text-destructive" role="alert" aria-live="polite">
Message should be at least 10 characters
</p>
</div>
);
}
export { Component };