{"id":15591196,"url":"https://github.com/coderberry/formaldehyde","last_synced_at":"2025-09-15T00:09:16.878Z","repository":{"id":66467361,"uuid":"53511217","full_name":"coderberry/formaldehyde","owner":"coderberry","description":"React form creation/validation/population. Supports top-down rendering with input population. Keeps the immutable data structures mindset.","archived":false,"fork":false,"pushed_at":"2016-03-09T16:02:33.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-10T21:03:42.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderberry.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-09T16:01:09.000Z","updated_at":"2016-03-09T16:01:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"e375bfda-7cb2-4531-b917-2d9a61a498bc","html_url":"https://github.com/coderberry/formaldehyde","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fformaldehyde","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fformaldehyde/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fformaldehyde/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fformaldehyde/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderberry","download_url":"https://codeload.github.com/coderberry/formaldehyde/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240122610,"owners_count":19751145,"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":"2024-10-02T23:40:33.618Z","updated_at":"2025-02-22T04:14:19.342Z","avatar_url":"https://github.com/coderberry.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/inlineblock/formaldehyde.svg)](https://travis-ci.org/inlineblock/formaldehyde)\n# Formaldehyde\n\n## What\n\nReact form creation/validation/population. Supports top-down rendering with input population. Keeps the immutable data structures mindset.\n\n\n## Why\n\nWe needed something elegant for creating forms and inputs that self populate, require no state, and at a input AND form levels, have easy use for validation.\n\n## How\n\n##### Install\n```bash\n$ npm i formaldehyde\n```\n\n```js\n# CreateUserForm.js\nimport React from 'react';\nimport { Form, Input, SubmitButton } from 'formaldehyde';\n\nexport default class CreateUserForm extends React.Component {\n  onSuccess (result) {\n    // if there is no action on the Form or if it returns nothing, this gets called immiediately\n    // otherwise if the action returns a promise, it will wait for it to finish\n    // the result is the result of the promise.\n    this.props.navigate(result.id);\n  }\n\n  onFormValidate (model) { // this function returns an array of errors.\n    const errors = [];\n    if (!model.agree) {\n      errors.push('You need to agree to the terms');\n    }\n    return errors;\n  }\n\n  render () {\n    return (\n      \u003cForm action={ this.props.action } onSuccess={ ::this.onSuccess } validateForm={ ::this.onFormValidate } model={ {} } showValidationErrors\u003e\n        \u003cp\u003e\n          \u003cInput type=\"text\" name=\"full_name\" placeholder=\"Full Name\" required /\u003e\n        \u003c/p\u003e\n        \u003cp\u003e\n          \u003cInput type=\"checkbox\" name=\"agree\" /\u003e \n        \u003c/p\u003e\n        \u003cp\u003e\n          \u003cSubmitButton className=\"button\"\u003eCreate User\u003c/SubmitButton\u003e\n        \u003c/p\u003e\n      \u003c/Form\u003e\n    );\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderberry%2Fformaldehyde","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderberry%2Fformaldehyde","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderberry%2Fformaldehyde/lists"}