@clarkeash/inertia-aria-form-hook
v1.1.1
Published
A custom React hook for ARIA-compliant forms with Inertia.js integration.
Downloads
8
Maintainers
Readme
inertia-aria-form-hook
Installation
Install with npm:
npm install @clarkeash/inertia-aria-form-hookOr with yarn:
yarn add @clarkeash/inertia-aria-form-hookUsage
import RegisteredUserController from '@/actions/App/Http/Controllers/Auth/RegisteredUserController';
import { Form, TextField, Label, Input } from "react-aria-components";
export default function Register() {
const { errors, isSubmitting, handleSubmit } = useInertiaAriaForm();
return (
<Form onSubmit={handleSubmit(RegisteredUserController.store().url)}>
<TextField name="name">
<Label>Name</Label>
<Input />
</TextField>
...
<Button type="submit">Submit</Button>
</Form>
);
}