import { Field } from '@precursor/field';Example
Release notes go to this address.
Enter a full email address.
import { Field, FieldDescription, FieldError } from '@precursor/field';
import Input from '@precursor/input';
import Label from '@precursor/label';
import { useId } from 'react';
export default function Example() {
const id = useId();
return (
<Field>
<Label htmlFor={id}>Review email</Label>
<Input
name="email"
id={id}
type="email"
defaultValue="example.com"
state="error"
aria-invalid
aria-describedby={id + '-hint ' + id + '-error'}
/>
<FieldDescription id={id + '-hint'}>
Release notes go to this address.
</FieldDescription>
<FieldError id={id + '-error'}>
Enter a full email address.
</FieldError>
</Field>
);
}
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
childrenRequired | ReactNode | — | — |