• Stars
    star
    162
  • Rank 232,284 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple component library, composed out of pure HTML form elements to make your live easier composing forms with Formik and React

React-Formik-UI

NPM npm bundle size license npm

Overview

React-Formik-UI is a simple component library, composed out of pure HTML form elements like: form, input, select, checkbox, radio and textarea.

The Idea behind React-Formik-UI is to make the composition of forms with React and Formik even easier, so you don't have to write any HTML markup or extra components for your forms.

Each component makes use of Formiks context, there for you need to have Formik installed in your project.

NEW in v5:

Typescript: React-Formik-UI is now written in Typescript

There where several breaking changes, if you come from version 4 please refer to Migrating from v4 to v5 section in this document for all the changes

Markup, Styling and ClassNames

The markup for the components Input, PhoneInput, Select, Checkbox, Radio, Textarea, Datepicker and DropZone consists of a wrapper div, label, the main component, hint, and error message.

By default all component have NO styling applied at all.
This is intentionally, so you have the possibility to apply your own styling through css or scss by passing a custom className.
All the components used in the Form are scoped by the default classes, situated on the Form component, react-formik-ui form-wrapper

Each component has its corresponding component class (eg: PhoneInput component phoneInput ) followed a level deeper by its wrapper class (eg: phoneInput component phoneInput-wrapper ), as well as the class form-element.

You can pass the style prop on each component, to add custom inline styles to the component main element. Lets say you ad a style object through the style prop on the Select component, the inline styles will be applied to the select element of the Select component.

The className Prop can be passed on each component to add a css class directly to the component instead of the wrapper div, so libraries like Bootstrap can be used to style the form component.

The Styling prop: If you pass the styling prop to the Form component with structure as value, a minimal styling will be applied to add some structure to each form-element.

In case you pass the value theme through the styling prop on the Form component, the React-Formik-Ui Theme will be applied

Migrating from v4 to v5:

  • Button component has been removed, therfore you should use your own.
  • SubmitBtn component now also recieves a text prop for rnedering the text of the button
  • mode prop has been renamed to styling, the values structured and themed for the it also have been renamed to structure and theme.
  • Datepicker component has been renamed to `DatePicker``
  • The style prop has been removed form the DatePicker and PhoneInputcomponent

Installation

Note: React Formik UI makes use of the recently released react Hooks API, therefore make sure that your project uses at least React version 16.13.1

yarn add react-formik-ui

or

npm i -S react-formik-ui

Usage

Peer Dependency

React-Formik-UI has Formik, React and react-dom as Peer dependencies.
So make shure to have those packages installed to your project to make use of React-Formik-UI.

yarn add formik

or

npm i -S formik

Form validations

To validate the form fields, the use of Yup is recommended.

yarn add yup

or

npm i -S yup

See the Styleguide with Demo and Examples here

Components Documentation and Examples

License

MIT © KaiHotz

Support

If you like the project and want to support my work, you can buy me a coffee :)

paypal

More Repositories

1

react-rollup-boilerplate

Boilerplate for creating React component libraries, bundled with Rollup.js to ESM and/or CJS Modules, Storybook, Typescript
TypeScript
299
star
2

React-PhoneNr-Input

An intuitive phone number input with country selector for international and national phone numbers
TypeScript
74
star
3

React-Redux-Saga-Advanced-Starter

Boilerplate for Advanced usage with React, Redux, React-Router-Redux, Redux-Saga, Immutable, Reselect, Recompose, Axios, HMR, Babel v7, Jest, Eslint, and more
JavaScript
66
star
4

React-Calculator-App

The Apple MacOs/iOS calculator app rebuild using React
TypeScript
54
star
5

React-Redux-Simple-Starter

Boilerplate project to get started wit React and Redux
JavaScript
10
star
6

React-Analog-Clock

Simple Analog Clock done with React and Styled Components
JavaScript
7
star
7

jQuery-Age-Gate-Plugin

Very configuralable Age verification, Age Gate or agegate, plugin required by some content providers for mature content.
JavaScript
5
star
8

Scss-Mixin-Collection

A Collection of several Scss Mixins and Functions
CSS
3
star
9

Scss-Dynamic-Sprite

Scss Mixing for Dynamic Sprite
CSS
3
star
10

React-Redux-GitHub-User-Search

A simple GitHub User Repo search app done wit react-redux
JavaScript
2
star
11

Scss-Circular-Progress

Scss Mixing for Circular Progress Bar
CSS
2
star
12

jQuery-Image-Rotator-Plugin

jQuery Image Rotator Plugin with preview on Next and Prev buttons
JavaScript
2
star
13

jQuery-Drupal-Webform-Validation-Plugin

jQuery Plugin for Drupal Webform Validation
JavaScript
2
star
14

React-Redux-Trip-Sorter-material-ui

Select your departure and destination, sort them by Cheapest or Fastest option
JavaScript
2
star
15

React-Mac-Calculator

The same Calculator as React-Calculator-App repo, but bundled with Rollup into an ES6 Module as a library
TypeScript
1
star
16

Scss-Animated-Circular-Progress

Scss code for an animated circular progress bar
CSS
1
star
17

React-Redux-Blog-Post-App

A small Blog Post app done with React-Redux, react-router v4 and redux-form v6
JavaScript
1
star
18

AirBnB-search

React Redux app to search AirBnB listings
JavaScript
1
star
19

gh-trends

A clone of the GitHub Trending page done 100% with React and GitHubs @primer component libraries
TypeScript
1
star
20

ReactJs-Youtube-Video-Player

Modern ReactJs YouTube Video Player with a Search Bar,Result List and Video Details using Youtube API
JavaScript
1
star
21

jQuery-Picture-Inject

Simple jQuery plugin that converts data-file-image-desktop and data-file-image-mobile attributes and converts them into html5 <picture> tag, realy usefull on any headless CMS
JavaScript
1
star
22

ReactJs-Github-User-Repo-List

App that lets you search for any Github username and list the available repos for this user
JavaScript
1
star