{"id":13755450,"url":"https://github.com/trendmicro-frontend/react-form-control","last_synced_at":"2025-09-04T14:32:29.517Z","repository":{"id":57158546,"uuid":"178191319","full_name":"trendmicro-frontend/react-form-control","owner":"trendmicro-frontend","description":"React Form Control component","archived":false,"fork":false,"pushed_at":"2023-09-22T14:10:25.000Z","size":720,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-12-12T12:51:33.675Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://trendmicro-frontend.github.io/react-form-control/","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/trendmicro-frontend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-03-28T11:39:39.000Z","updated_at":"2023-09-22T14:10:30.000Z","dependencies_parsed_at":"2024-01-17T15:04:18.991Z","dependency_job_id":"b625da5a-5b15-46a6-834e-e1593d2571ba","html_url":"https://github.com/trendmicro-frontend/react-form-control","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-form-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-form-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-form-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendmicro-frontend%2Freact-form-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trendmicro-frontend","download_url":"https://codeload.github.com/trendmicro-frontend/react-form-control/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231970041,"owners_count":18453906,"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-08-03T10:00:54.420Z","updated_at":"2024-12-31T09:32:46.181Z","avatar_url":"https://github.com/trendmicro-frontend.png","language":"JavaScript","funding_links":[],"categories":["Trend Micro"],"sub_categories":["React Components"],"readme":"# react-form-control [![build status](https://travis-ci.org/trendmicro-frontend/react-form-control.svg?branch=master)](https://travis-ci.org/trendmicro-frontend/react-form-control) [![Coverage Status](https://coveralls.io/repos/github/trendmicro-frontend/react-form-control/badge.svg?branch=master)](https://coveralls.io/github/trendmicro-frontend/react-form-control?branch=master)\n\n[![NPM](https://nodei.co/npm/@trendmicro/react-form-control.png?downloads=true\u0026stars=true)](https://nodei.co/npm/@trendmicro/react-form-control/)\n\nReact Form Control\n\nDemo: https://trendmicro-frontend.github.io/react-form-control\n\n## Installation\n\n1. Install the latest version of [react](https://github.com/facebook/react) and [react-form-control](https://github.com/trendmicro-frontend/react-form-control):\n\n  ```\n  npm install --save react @trendmicro/react-form-control\n  ```\n\n2. At this point you can import `@trendmicro/react-form-control` and its styles in your application as follows:\n\n  ```js\n  import FormControl, { Input, Select, Textarea } from '@trendmicro/react-form-control';\n\n  // Be sure to include styles at some point, probably during your bootstraping\n  import '@trendmicro/react-form-control/dist/react-form-control.css';\n  ```\n\n## Overview\n\n### Form controls\n\nThe `\u003cFormControl\u003e` component renders a form control with block-level styling (`display: block` and `width: 100%`). Supported textual form controls includes `\u003cInput\u003e`, `\u003cSelect\u003e`, and `\u003cTextarea\u003e`.\n\n```jsx\n\u003cFormGroup\u003e\n    \u003clabel\u003eEmail address\u003c/label\u003e\n    \u003cInput type=\"text\" placeholder=\"name@example.com\" /\u003e\n\u003c/FormGroup\u003e\n\u003cFormGroup\u003e\n    \u003clabel\u003eExample select\u003c/label\u003e\n    \u003cSelect defaultValue=\"1\"\u003e\n        \u003coption value=\"1\"\u003e1\u003c/option\u003e\n        \u003coption value=\"2\"\u003e2\u003c/option\u003e\n        \u003coption value=\"3\"\u003e3\u003c/option\u003e\n        \u003coption value=\"4\"\u003e4\u003c/option\u003e\n        \u003coption value=\"5\"\u003e5\u003c/option\u003e\n    \u003c/Select\u003e\n\u003c/FormGroup\u003e\n\u003cFormGroup\u003e\n    \u003clabel\u003eExample multiple select\u003c/label\u003e\n    \u003cSelect multiple defaultValue=\"1\"\u003e\n        \u003coption value=\"1\"\u003e1\u003c/option\u003e\n        \u003coption value=\"2\"\u003e2\u003c/option\u003e\n        \u003coption value=\"3\"\u003e3\u003c/option\u003e\n        \u003coption value=\"4\"\u003e4\u003c/option\u003e\n        \u003coption value=\"5\"\u003e5\u003c/option\u003e\n    \u003c/Select\u003e\n\u003c/FormGroup\u003e\n\u003cFormGroup\u003e\n    \u003clabel\u003eExample textarea\u003c/label\u003e\n    \u003cTextarea rows={3} /\u003e\n\u003c/FormGroup\u003e\n```\n\n### Form groups\n\nUsing the `\u003cFormGroup\u003e` component is the easiest way to add some structure to forms, it provides a flexible way that encourages proper grouping of labels, controls, and form validation messaging.\n\nThe `\u003cFormGroup\u003e` component is not provided here, but you can use [styled-components](https://github.com/styled-components/styled-components) to style with plain CSS styles. By default, it only applies `margin-bottom` as below:\n\n```jsx\nconst FormGroup = styled.div`\n    margin-bottom: 12px;\n`;\n```\n\n## API\n\n### Properties\n\n#### FromControl\n\nName | Type | Default | Description\n:--- | :--- | :------ | :----------\ntag | element | 'div' |\nlg | boolean | |\nmd | boolean | | Defaults to 'md' if nothing is specified.\nsm | boolean | |\n\n#### Input\n\nName | Type | Default | Description\n:--- | :--- | :------ | :----------\ntag | element | 'input' |\nlg | boolean | |\nmd | boolean | | Defaults to 'md' if nothing is specified.\nsm | boolean | |\n\n#### Select\n\nName | Type | Default | Description\n:--- | :--- | :------ | :----------\ntag | element | 'select' |\nlg | boolean | |\nmd | boolean | | Defaults to 'md' if nothing is specified.\nsm | boolean | |\n\n#### Textarea\n\nName | Type | Default | Description\n:--- | :--- | :------ | :----------\ntag | element | 'textarea' |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendmicro-frontend%2Freact-form-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrendmicro-frontend%2Freact-form-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendmicro-frontend%2Freact-form-control/lists"}