Gathering detailed insights and metrics for @toolsify/form
Gathering detailed insights and metrics for @toolsify/form
Gathering detailed insights and metrics for @toolsify/form
Gathering detailed insights and metrics for @toolsify/form
npm install @toolsify/form
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A comprehensive library of form components built with Mantine and React Hook Form. It provides pre-configured components, utilities, and wrappers for seamless form management in React applications.
Install the package using npm or yarn:
1npm install @toolsify/form 2# or 3yarn add @toolsify/form
Make sure the following peer dependencies are installed in your project:
react
react-dom
@toolsify/core
You can install them using:
1npm install react react-dom @toolsify/core
Below is the list of components provided by the library:
The FormProvider
is a wrapper for managing form state using React Hook Form. It simplifies form handling and submission.
1import React from "react"; 2import { useForm, FormProvider } from "@toolsify/form/providers"; 3import { TextInput } from "@toolsify/form"; 4 5const App = () => { 6 const methods = useForm(); 7 8 const onSubmit = (data: any) => { 9 console.log(data); 10 }; 11 12 return ( 13 <FormProvider {...methods} onSubmit={methods.handleSubmit(onSubmit)}> 14 <TextInput name="example" label="Example Input" /> 15 <button type="submit">Submit</button> 16 </FormProvider> 17 ); 18}; 19 20export default App;
The library provides built-in support for schema validation using zod
and yup
resolvers.
1import React from "react"; 2import { useForm, FormProvider } from "@toolsify/form/providers"; 3import { z } from "zod"; 4import { zodResolver } from "@toolsify/form/plugins"; 5import { TextInput } from "@toolsify/form"; 6 7const schema = z.object({ 8 email: z.string().email("Invalid email address"), 9}); 10 11const App = () => { 12 const methods = useForm({ 13 resolver: zodResolver(schema), 14 }); 15 16 const onSubmit = (data: any) => { 17 console.log(data); 18 }; 19 20 return ( 21 <FormProvider {...methods} onSubmit={methods.handleSubmit(onSubmit)}> 22 <TextInput name="email" label="Email Address" /> 23 <button type="submit">Submit</button> 24 </FormProvider> 25 ); 26}; 27 28export default App;
A basic wrapper around Mantine's TextInput
component, integrated with React Hook Form.
1import React from "react"; 2import { TextInput } from "@toolsify/form"; 3 4const App = () => { 5 return <TextInput name="example" label="Example Input" />; 6}; 7 8export default App;
A drag-and-drop file upload component with preview support.
1import React from "react"; 2import { FileUpload } from "@toolsify/form"; 3 4const App = () => { 5 return <FileUpload name="files" label="Upload Files" />; 6}; 7 8export default App;
A date input field integrated with React Hook Form.
1import React from "react"; 2import { DateInput } from "@toolsify/form"; 3 4const App = () => { 5 return <DateInput name="date" label="Select Date" />; 6}; 7 8export default App;
This project is licensed under the MIT License.
No vulnerabilities found.
No security vulnerabilities found.