Giter VIP home page Giter VIP logo

bartstc / react-hook-form-chakra-fields Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 7.0 375 KB

A collection of form fields on top of Chakra UI and React Hook Form, integrated with many other js/ts libraries.

Home Page: https://github.com/bartstc/react-hook-form-chakra-fields

License: MIT License

JavaScript 1.33% HTML 0.82% TypeScript 97.86%
chakra-ui chakra-ui-icons react react-hook-form typescript tsdx currencyjs dayjs react-datepicker react-number-format

react-hook-form-chakra-fields's Introduction

React Hook Form Chakra Fields

A collection of form fields on top of simple and accessible react component library Chakra UI and performant form library React Hook Form, integrated with many other js/ts libraries.

Included inputs and form fields:

  • Input Field - standard input field
  • Masked Input Field - input field with the ability to set any mask you want for example phone or time
  • Money Field - input field intended for monetary values (you can easily extend it with for example currency select)
  • Select Field - advanced select field on top of powerful react-select library
  • Date Field - standard date select field on top of react-datepicker library
  • DateTimeField - date select field integrated with additional input for providing a specific time
  • DateTimeOnlyField - time field for time value only

All components are accessible (thanks Chakra UI!) and have support for chakra UI dark mode.

Installation

You need to install all below-mentioned libraries as a peer dependencies of this package.

yarn add react-hook-form chakra-ui/react chakra-ui/icons @emotion/react @emotion/styled framer-motion currency.js dayjs react-datepicker react-number-format react-select react-text-mask
yarn add -D @types/react-datepicker @types/react-text-mask @types/react-select
yarn add react-hook-form-chakra-fields

Usage Examples - TODO

You can always check this project repository to see how to use this library.

Meta

This library was invented with TSDX.

react-hook-form-chakra-fields's People

Contributors

bartstc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-hook-form-chakra-fields's Issues

Add support for react-number-format v5

During the first setup, react-number-format was installed with version 5.3.1.

Between v4 and v5 there are a few breaking changes and I run into

6: import NumberFormat from 'react-number-format';
          ^
[..]
error during build:
RollupError: "default" is not exported by "../../node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/react-number-format/dist/react-number-format.es.js", imported by "../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@emotion+re_kecz67imlc4dja4o5pzcfdqrli/node_modules/react-hook-form-chakra-fields/dist/react-hook-form-chakra-fields.esm.js".

This is also documented in the migration guide.

Downgrading react-number-format to version 4.9.4 solved the problem.

Missing dependency lodash-es

Thanks for publishing this project. It looks really promising.
I noted a few things during the initial setup and will create separate issues.

Using pnpm with vite, I got the following error during build:

Error: [vite]: Rollup failed to resolve import "lodash-es" from "[..]/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@emotion+re_kecz67imlc4dja4o5pzcfdqrli/node_modules/react-hook-form-chakra-fields/dist/react-hook-form-chakra-fields.esm.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

Installing lodash-es solved it:

pnpm add lodash-es

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.