New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-final-form-fields

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-final-form-fields

> 🥂 Version 2! Now supporting `react-native-web` and `react-native`! Works sort of the same all around!

npmnpm
Version
2.0.9
Version published
Weekly downloads
20
233.33%
Maintainers
1
Weekly downloads
 
Created
Source

React Final Form Fields

🥂 Version 2! Now supporting react-native-web and react-native! Works sort of the same all around!

This library creates some simple drop-in form field for react-final-form. They include in each field container a label and error.

The TextInput component also allows the following types:

  • text
  • password
  • newPassword
  • date
  • pin
  • phone

FormBuilder

The form builder component allows you to build complete forms easily.

<FormBuilder
  onSubmit={console.log}
  validator={values => ({ banned: `${values.email} is banned` })}
  Email={{
    render: TextField,
    options: {
      placeholder: 'This is a demo only, these will look like fields one day.',
      input: { style: { backgroundColor: 'red' } },
    },
  }}
  Button={{
    component: Button,
    options: {
      secondary: true,
      large: true,
      bold: true,
      render: () => (
        <View>
          <Text>LOG IN</Text>
        </View>
      ),
    },
  }}
  styles={{
    outerContainer: `
      background-color: white;
    `,
    fieldContainer: `
      background-color: tranparent;
    `,
    innerContainer: `
      height: 300;
    `,
  }}
/>

This will return an error saying the email is banned.

Styling

⚠️ To style components, pass something like this into Field as the containers prop.

const containers = {
  OuterContainer: styled.View`
    border-style: dotted;
    border-color: green;
    border-width: 3;
    width: 100%;
    padding-vertical: 15;
    padding-horizontal: 15;
  `,
  LabelContainer: styled.View`
    position: absolute;
    margin-left: 16;
    max-width: 85;
    top: 10;
    z-index: 2;
    background-color: ${({ meta: { error } }) => (error ? 'white' : 'white')};
    justify-content: center;
    align-items: center;
    padding-horizontal: 5;
  `,
  Label: styled.Text`
    color: red;
    font-size: 12;
    line-height: 15;
  `,
  FieldContainer: styled.View`
    margin-top: 10;
    width: 100%;
    flex-grow: 1;
    flex-direction: row;
  `,
  FieldElement: styled.TextInput`
    margin-top: 10;
    width: 100%;
    background-color: gray;
  `,
  ErrorContainer: styled.View`
    margin-left: 10;
    margin-top: 10;
  `,
  ErrorText: styled.Text`
    color: pink;
  `,
}

Drop-in field components for react-final-form on all platforms (ios, Android, web).

Component🤖Web
Radio?
Button?
Calendar👷‍♀??
Checkbox?
FloatingActionButton???
HeaderButtonBack
Icons ©
TextField?

Preview it

Do a git clone or npm install. Go to project folder. run yarn and yarn run storybook.

FAQs

Package last updated on 18 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts