
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-clean-form
Advanced tools
An example of creating mobile forms with React Native, styled-components and redux-form
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="esbenspetersen@gmail.com" 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="something@domain.com" />
</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
FAQs
An example of creating mobile forms with React Native, styled-components and redux-form
The npm package react-native-clean-form receives a total of 21 weekly downloads. As such, react-native-clean-form popularity was classified as not popular.
We found that react-native-clean-form demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.