Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
React Native Clean Form | 461 | 27 | 2 | 4 years ago | 4 | January 03, 2018 | 41 | mit | JavaScript | |
Easy react-native forms using bootstrap-like syntax with redux-form+immutablejs integration. Styled using styled-components | ||||||||||
Ultraviolet | 88 | 8 hours ago | 12 | apache-2.0 | TypeScript | |||||
A monorepo Design System with React components. | ||||||||||
Thecyberhub | 71 | 10 hours ago | 14 | mit | JavaScript | |||||
Welcome to TheCyberHUB, a community-driven platform for hackers, cybersecurity enthusiasts, and IT professionals. Our platform provides a variety of free resources, including Capture The Flag (CTF) challenges, courses, blogs, forums, and much more. | ||||||||||
Forms With Formik | 23 | 5 years ago | mit | |||||||
A source repository for a blog post about dynamic forms with Formik | ||||||||||
Svelte Multistep Form | 16 | 2 years ago | 2 | mit | JavaScript | |||||
Svelte MultiStep Form like, this component is still in beta stage | ||||||||||
Basestack | 10 | 5 days ago | 1 | agpl-3.0 | TypeScript | |||||
The Open-Source Stack for Developers and Startups | ||||||||||
React Native Nubank | 7 | 2 years ago | 16 | mit | JavaScript | |||||
This project was developed as a form of study using React Native in order to learn and refactor the Nubank application in a simpler way, without many functionalities. | ||||||||||
Receipt Form | 5 | a year ago | 25 | TypeScript | ||||||
Receipt form as a lambda function and React app | ||||||||||
Chicagotechevents.com | 5 | 3 years ago | 107 | JavaScript | ||||||
Website for chicagotechevents.com - The best web, tech and startup events in Chicago | ||||||||||
Mentari | 3 | 4 years ago | n,ull | mit | JavaScript | |||||
Dana Cita UI Kit |
Easy react-native forms using bootstrap-like syntax with redux-form+immutablejs integration. Styled using styled-components
The look of the form was inspired by this shot by Artyom Khamitov. Check out his profile on Dribbble.
Run npm install --save react-native-clean-form
The form uses react-native-vector-icons
so it is important the fonts are linked by using react-native link
or one of the other options available.
I have written an article on my blog about React Native and redux-form
For a complete example check out the example folder
import {
ActionsContainer,
Button,
FieldsContainer,
Fieldset,
Form,
FormGroup,
Input,
Label,
Switch
} from 'react-native-clean-form'
const FormView = props => (
<Form>
<FieldsContainer>
<Fieldset label="Contact details">
<FormGroup>
<Label>First name</Label>
<Input placeholder="Esben" onChangeText={this.onFirstNameChange} />
</FormGroup>
<FormGroup>
<Label>Email</Label>
<Input placeholder="[email protected]" onChangeText={this.onEmailChange} />
</FormGroup>
</Fieldset>
<Fieldset label="Password" last>
<FormGroup>
<Label>Password</Label>
<Input placeholder="Enter a password" onChangeText={this.onPasswordChange} />
</FormGroup>
<FormGroup>
<Label>Repeat password</Label>
<Input placeholder="Repeat your password" onChangeText={this.onRepeatPasswordChange} />
</FormGroup>
<FormGroup border={false}>
<Label>Save my password</Label>
<Switch onValueChange={this.toggleSaveMyPassword} />
</FormGroup>
</Fieldset>
</FieldsContainer>
<ActionsContainer>
<Button icon="md-checkmark" iconPlacement="right" onPress={this.save}>Save</Button>
</ActionsContainer>
</Form>
)
import React from 'react'
import { reduxForm } from 'redux-form'
import {
ActionsContainer,
Button,
FieldsContainer,
Fieldset,
Form,
FormGroup,
Label,
} from 'react-native-clean-form'
import {
Input,
Switch
} from 'react-native-clean-form/redux-form'
import { View,Text } from 'react-native'
const onSubmit = (values, dispatch) => {
return new Promise((resolve) => {
setTimeout(() => {
console.log(values)
resolve()
}, 1500)
})
}
const FormView = props => {
const { handleSubmit, submitting } = this.props
return (
<Form>
<FieldsContainer>
<Fieldset label="Contact details">
<Input name="first_name" label="First name" placeholder="John" />
<Input name="email" label="Email" placeholder="[email protected]" />
</Fieldset>
<Fieldset label="Shipping details" last>
<Input name="password" label="Address" placeholder="Hejrevej 33" />
<Input name="password_repeat" label="City" placeholder="Copenhagen" />
<Switch label="Save my details" border={false} name="save_details" />
</Fieldset>
</FieldsContainer>
<ActionsContainer>
<Button icon="md-checkmark" iconPlacement="right" onPress={handleSubmit(onSubmit)} submitting={submitting}>Save</Button>
</ActionsContainer>
</Form>
)
}
export default reduxForm({
form: 'Form'
})(FormView)
To make it work with Immutable.js import Input
, Select
, and Switch
from react-native-clean-form/redux-form-immutable
instead of react-native-clean-form/redux-form
.
Also, check out the included example
If integrating with redux-form
validation is supported right out of the box. Just add a validation
key to reduxForm
your normally would.
If not using redux-form
, there is an error
prop on FormGroup
which will display the error if used.
The Button
component has a submitting
prop. If true, a spinner will be displayed.
Clone the repo first.
git clone https://github.com/esbenp/react-native-clean-form && cd react-native-clean-form
Install dependencies.
cd example
npm install
Run the simulator.
react-native run-ios