{"id":22403305,"url":"https://github.com/springload/react-simpler-select","last_synced_at":"2025-07-31T16:31:45.877Z","repository":{"id":57344801,"uuid":"54068152","full_name":"springload/react-simpler-select","owner":"springload","description":"React component that renders a select. Supports optgroups, multiple selections.","archived":false,"fork":false,"pushed_at":"2017-06-14T22:30:33.000Z","size":285,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-11-05T02:16:51.340Z","etag":null,"topics":["dropdown","react","react-component","select"],"latest_commit_sha":null,"homepage":"https://springload.github.io/react-simpler-select/","language":"JavaScript","has_issues":true,"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/springload.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-03-16T21:34:59.000Z","updated_at":"2020-01-21T21:33:46.000Z","dependencies_parsed_at":"2022-09-16T07:51:35.268Z","dependency_job_id":null,"html_url":"https://github.com/springload/react-simpler-select","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-simpler-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-simpler-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-simpler-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Freact-simpler-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springload","download_url":"https://codeload.github.com/springload/react-simpler-select/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228224705,"owners_count":17887839,"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":["dropdown","react","react-component","select"],"created_at":"2024-12-05T09:16:41.026Z","updated_at":"2024-12-05T09:16:41.637Z","avatar_url":"https://github.com/springload.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [react-simpler-select](https://springload.github.io/react-simpler-select/) [![npm](https://img.shields.io/npm/v/react-simpler-select.svg)](https://www.npmjs.com/package/react-simpler-select) [![Build Status](https://travis-ci.org/springload/react-simpler-select.svg?branch=master)](https://travis-ci.org/springload/react-simpler-select) [![Coverage Status](https://coveralls.io/repos/github/springload/react-simpler-select/badge.svg)](https://coveralls.io/github/springload/react-simpler-select)\n\n\u003e React component that renders a select. Supports optgroups, multiple selections.\n\nCheck out the [online demo](https://springload.github.io/react-simpler-select/)!\n\n## Features\n\n- Renders a plain, accessible HTML `\u003cselect\u003e`.\n- Generates `\u003coption\u003e` elements itself from the expected data structure.\n- Has a `placeholder` prop to create a placeholder option at the top of the select.\n- Generates `\u003coptgroup\u003e` elements if the `options` follow the expected data structure.\n- `onChange` returns supports single and `multiple` values in a convenient format.\n\n## Installation\n\n```sh\nnpm install --save react-simpler-select\n```\n\n## Usage\n\n```jsx\nimport Select from 'react-simpler-select';\n\nconst options = [\n  { value: 'en', label: 'English' },\n  { value: 'es', label: 'Spanish' },\n];\n\n\u003cSelect\n  placeholder=\"Choose a language\"\n  value=\"en\"\n  options={options}\n  onChange={onChange}\n/\u003e\n\n// Add props as you go, they will be transfered to the `select` element.\n\u003cSelect\n  value=\"en\"\n  options={options}\n  onChange={this.handleChange}\n  autoFocus\n/\u003e\n\n// Supports `optgroup`s with their own array of options.\nconst optgroups = [\n  {\n    title: 'North Island',\n    id: 'ni',\n    options: [ { value: 'wgtn', label: 'Wellington' }, { value: 'gsb', label: 'Gisbourne' } ]\n  },\n  {\n    title: 'South Island',\n    id: 'si',\n    options: [ { value: 'ch', label: 'Christchurch' }, { value: 'qt', label: 'Queenstown' } ]\n  },\n];\n\n\u003cSelect options={optgroups}/\u003e\n\n// Supports `multiple` select. Just make the `value` prop an array, and get selected options as an array in the `onChange` callback.\n\u003cSelect value={[ 'ch', 'qt']}/\u003e\n```\n\n## Development\n\n### Install\n\n\u003e Clone the project on your computer, and install [Node](https://nodejs.org). This project also uses [nvm](https://github.com/creationix/nvm).\n\n```sh\nnvm install\n# Then, install all project dependencies.\nnpm install\n# Install the git hooks.\n./.githooks/deploy\n```\n\n### Working on the project\n\n\u003e Everything mentioned in the installation process should already be done.\n\n```sh\n# Make sure you use the right node version.\nnvm use\n# Start the server and the development tools.\nnpm run start\n# Runs linting.\nnpm run lint\n# Runs tests.\nnpm run test\n# View other available commands with:\nnpm run\n```\n\n### Releases\n\n- Make a new branch for the release of the new version.\n- Update the [CHANGELOG](CHANGELOG.md).\n- Update the version number in `package.json`, following semver.\n- Make a PR and squash merge it.\n- Back on master with the PR merged, follow the instructions below.\n\n```sh\nnpm run dist\n# Use irish-pub to check the package content. Install w/ npm install -g first.\nirish-pub\nnpm publish\n```\n\n- Finally, go to GitHub and create a release and a tag for the new version.\n- Done!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Freact-simpler-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringload%2Freact-simpler-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Freact-simpler-select/lists"}