{"id":29023001,"url":"https://github.com/bamlab/react-native-form-idable","last_synced_at":"2025-06-26T03:04:56.855Z","repository":{"id":16731809,"uuid":"80556185","full_name":"bamlab/react-native-form-idable","owner":"bamlab","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-03T12:24:26.000Z","size":1308,"stargazers_count":14,"open_issues_count":64,"forks_count":3,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-06-14T16:03:08.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bamlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-31T19:54:15.000Z","updated_at":"2023-04-12T22:08:44.000Z","dependencies_parsed_at":"2023-01-13T22:15:17.651Z","dependency_job_id":null,"html_url":"https://github.com/bamlab/react-native-form-idable","commit_stats":null,"previous_names":["almouro/react-native-form-idable"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/bamlab/react-native-form-idable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamlab%2Freact-native-form-idable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamlab%2Freact-native-form-idable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamlab%2Freact-native-form-idable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamlab%2Freact-native-form-idable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bamlab","download_url":"https://codeload.github.com/bamlab/react-native-form-idable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamlab%2Freact-native-form-idable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261990349,"owners_count":23241188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-26T03:04:55.480Z","updated_at":"2025-06-26T03:04:56.837Z","avatar_url":"https://github.com/bamlab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-form-idable\n\n## Installation\n\n```\nyarn add react-native-form-idable\n```\n\n## Features\n\n- Sets input props based on the type you pass it. For instance, `type=\"email\"` implies `autocorrect=\"false\"`\n- Automatically adds a submit function\n- Validation available out of the box but highly customizable\n- Native-like DatePicker with same API for both Android \u0026 iOS\n- Highly customizable components and validation with React Native like API\n\n## Usage\n\nThis is a minimal example:\n```javascript\nimport { Form, TextInput } from 'react-native-form-idable';\n\n...\n\n\u003cForm\n  formStyles={formStyles}\n  toastErrors\n  onSubmit={formData =\u003e console.log(formData)}\n  onValidationError={errors =\u003e console.log(errors)}\n\u003e\n  \u003cTextInput\n    name=\"email\"\n    placeholder=\"Email\"\n    type=\"email\"\n    required\n  /\u003e\n  \u003cTextInput\n    name=\"password\"\n    placeholder=\"Password\"\n    type=\"password\"\n    required\n  /\u003e\n  \u003cTouchableOpacity type=\"submit\"\u003e\n    \u003cText\u003eSubmit\u003c/Text\u003e\n  \u003c/TouchableOpacity\u003e\n\u003c/Form\u003e\n```\n\nIn the example above, if the inputs are filled, when pressing on the buttons, the `onSubmit` prop will be called with\n```\n{\n  email: \"react-native@formidab.le\",\n  password: \"very secure password\"\n}\n```\n\nHow it works:\n- The `Form` component wraps the inputs and handles the logic\n- **One of the direct child should have a `type=\"submit\"` prop.** The form will add an `onPress` prop on it, which will call the `onSubmit` prop with the `formData` when clicking\n\n### Styling the form\n\n**The styles are passed through the `formStyles` prop.** Here are the available style props:\n\n- **inputContainerStyle:** style applied to the global container (View)\n- **nonEditableInput:** style applied to the global container when TextInput is not editable\n- **inputLabelContainer:** style applied to the label container (View)\n- **inputLabel:** style applied to the text label (Text)\n- **activeInputLabel:** style applied to the text label when focused or filled (Text)\n- **fieldContainer:** style applied to the field container (View)\n- **activeFieldContainer:** style applied to the field container when focused (View)\n- **validFieldContainer:** style applied to the field container when filled with valid info (View)\n- **fieldText:** style applied to the input (TextInput)\n- **activeFieldText:** style applied to the input when focused (TextInput)\n- **validFieldText:** style applied to the input when filled with valid info (TextInput)\n- **errorTextContainer:** style applied to the error container (View)\n- **placeholderAndSelectionColors:** color of the selection bar and of the placeholder\n- **activePlaceholderAndSelectionColors:** color of the selection bar and of the placeholder when focused or filled\n- **error:** style applied to the error text (Text)\n\n## Expo Example\n\nThere's an expo example available in `./example`.\n\nYou can [try out the published version](https://exp.host/@almouro/example) with the Expo app.\n\n## More advanced example\n\n```javascript\nimport React, { Component } from 'react';\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\nimport { DatePicker, Picker, Form, TextInput } from 'react-native-form-idable';\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    paddingTop: 40,\n  },\n  button: {\n    alignSelf: 'stretch',\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: 'blue',\n    paddingHorizontal: 10,\n    minHeight: 40,\n  },\n  buttonText: {\n    fontSize: 20,\n    color: 'white',\n  },\n  form: {\n    borderTopWidth: 1,\n    borderTopColor: '#ddd',\n  },\n});\n\nconst formStyles = {\n  fieldContainer: {\n    backgroundColor: 'white',\n    borderBottomWidth: 1,\n    borderBottomColor: '#ddd',\n  },\n  fieldText: {\n    color: '#333',\n    fontSize: 14,\n    fontWeight: '600',\n    paddingHorizontal: 20,\n    paddingVertical: 12,\n  },\n};\n\nexport default class FormidableExample extends Component {\n  onSubmit = formData =\u003e console.log(formData);\n\n  render() {\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cForm\n          formStyles={formStyles}\n          onSubmit={this.onSubmit}\n          toastErrors\n          style={styles.form}\n          onValidationError={errors =\u003e console.log(errors)}\n        \u003e\n          \u003cTextInput name=\"email\" placeholder=\"Email\" type=\"email\" required /\u003e\n          \u003cPicker name=\"language\" type=\"language\" placeholder=\"Language\" formStyles={formStyles}\u003e\n            \u003cPicker.Item label=\"English\" value=\"en\" /\u003e\n            \u003cPicker.Item label=\"French\" value=\"fr\" /\u003e\n          \u003c/Picker\u003e\n          \u003cDatePicker\n            name=\"birthdate\"\n            type=\"date\"\n            placeholder=\"Birthdate\"\n            minimumDate={new Date(1992, 7, 17)}\n            date={new Date(2017, 8, 1)}\n            maximumDate={new Date(2017, 8, 10)}\n          /\u003e\n          \u003cDatePicker\n            format={'HH:mm'}\n            name=\"hour\"\n            type=\"date\"\n            placeholder=\"Hour\"\n            mode=\"time\"\n            androidMode=\"calendar\"\n            is24Hour\n            minuteInterval={30}\n            timeZoneOffsetInMinutes={-7 * 60}\n            date={new Date(2017, 8, 1, 14, 54)}\n          /\u003e\n          \u003cDatePicker\n            format={'D MMMM YYYY HH:mm'}\n            name=\"datetime\"\n            type=\"datetime\"\n            placeholder=\"Datetime\"\n            mode=\"datetime\"\n            androidMode=\"calendar\"\n            date={new Date(2017, 8, 1, 14, 54)}\n          /\u003e\n          \u003cTextInput name=\"password\" placeholder=\"Password\" type=\"password\" required /\u003e\n          \u003cTouchableOpacity type=\"submit\" style={styles.button}\u003e\n            \u003cText style={styles.buttonText}\u003eSubmit\u003c/Text\u003e\n          \u003c/TouchableOpacity\u003e\n        \u003c/Form\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n```\n\n## Contributing\n\nCommits follow the Angular commit convention to create releases automatically.\n\nTo help you out, you can run\n```\nyarn\nyarn commit\n```\nin the repo\n\n### Creating releases\n\ncommitizen uses semantic-release to release new versions automatically.\n\nCommits of type fix will trigger bugfix releases, think 0.0.1\nCommits of type feat will trigger feature releases, think 0.1.0\nCommits with BREAKING CHANGE in body or footer will trigger breaking releases, think 1.0.0\nAll other commit types will trigger no new release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbamlab%2Freact-native-form-idable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbamlab%2Freact-native-form-idable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbamlab%2Freact-native-form-idable/lists"}