Field error
The red line under a text field when what you typed does not pass.
Add it to your project
Or install the packages yourselfTerminal
npm install @heroui/react
First time with HeroUI? Set it up once.
The code
*/
"use client";
import {FieldError, Input, Label, TextField} from "@heroui/react";
import {useState} from "react";
export default function FieldErrorDemo() {
const [value, setValue] = useState("jr");
const isInvalid = value.length > 0 && value.length < 3;
return (
<TextField className="w-64" isInvalid={isInvalid}>This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.
Changed for this site: A default export (HeroUI's docs use named ones).