{"id":19852980,"url":"https://github.com/ship-components/ship-components-buttons","last_synced_at":"2026-04-11T02:02:14.681Z","repository":{"id":5262602,"uuid":"46018036","full_name":"ship-components/ship-components-buttons","owner":"ship-components","description":"React buttons. Exports a commonjs module that can be used with webpack.","archived":false,"fork":false,"pushed_at":"2023-01-04T21:49:07.000Z","size":4251,"stargazers_count":0,"open_issues_count":24,"forks_count":1,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-06-03T18:50:37.772Z","etag":null,"topics":["babel","buttons","commonjs","jest","jsx","loader","react","webpack"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ship-components-buttons","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/ship-components.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}},"created_at":"2015-11-12T00:04:22.000Z","updated_at":"2019-12-02T19:26:36.000Z","dependencies_parsed_at":"2023-01-13T13:45:08.858Z","dependency_job_id":null,"html_url":"https://github.com/ship-components/ship-components-buttons","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ship-components/ship-components-buttons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-buttons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-buttons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-buttons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-buttons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ship-components","download_url":"https://codeload.github.com/ship-components/ship-components-buttons/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-buttons/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262094419,"owners_count":23257961,"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":["babel","buttons","commonjs","jest","jsx","loader","react","webpack"],"created_at":"2024-11-12T14:05:04.978Z","updated_at":"2026-04-11T02:02:14.574Z","avatar_url":"https://github.com/ship-components.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ship-components-buttons\n\n[React](http://facebook.github.io/react/) buttons. Exports a commonjs module that can be used with [webpack](http://webpack.github.io/). Source is in ES6 and is compiled down to ES5 using [Babel](https://babeljs.io/).\n\n[![npm](https://img.shields.io/npm/v/ship-components-buttons.svg)](https://www.npmjs.com/package/ship-components-buttons) [![coverage](https://img.shields.io/coveralls/ship-components/ship-components-buttons.svg)](https://coveralls.io/github/ship-components/ship-components-buttons) [![Build Status](http://img.shields.io/travis/ship-components/ship-components-buttons/master.svg?style=flat)](https://travis-ci.org/ship-components/ship-components-buttons) [![dependencies](https://img.shields.io/david/ship-components/ship-components-buttons.svg?style=flat)](https://david-dm.org/ship-components/ship-components-buttons) [![devDependencies](https://img.shields.io/david/dev/ship-components/ship-components-buttons.svg?style=flat)](https://david-dm.org/ship-components/ship-components-buttons?type=dev)\n\n## Usage\n\n### ES6/JSX (Recommended)\n\nThe component is written using ES6/JSX therefore Babel is recommended to use it. The below example is based on using [webpack](http://webpack.github.io/) and [babel-loader](https://github.com/babel/babel-loader).\n\n```javascript\nimport React from 'react';\nimport { Button } from 'ship-components-buttons';\n\nexport default class Dialog extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      clicked: false\n    };\n  }\n\n  handleClick(event) {\n    this.setState({\n      clicked: true\n    });\n  }\n\n  render() {\n    return (\n        \u003cdiv className='form-group'\u003e\n          \u003cButton onClick={this.handleClick.bind(this)}\u003e\n            Click Me!\n          \u003c/Button\u003e\n        \u003c/div\u003e\n    );\n  }\n}\n```\n\n## Examples and Development\n\nExamples can be found in the `examples/` folder. A development server can be run with:\n\n```shell\n$ npm install\n$ npm start\n```\n\nwhich will live reload any changes you make and serve them at \u003chttp://localhost:8080\u003e.\n\n### Webpack Configuration\n\nThis module is designed to be used with webpack but requires a few loaders if you are pulling the source into another project.\n\n```shell\n$ npm install webpack babel-loader css-loader style-loader postcss-loader extract-text-webpack-plugin postcss-nested postcss-color-hex-alpha postcss-color-function postcss-calc postcss-simple-vars autoprefixer --save-dev\n```\n\nBelow are is a sample of how to setup the loaders:\n\n```javascript\n/**\n * Relevant Webpack Configuration\n */\n{\n  [...]\n  module: {\n    loaders: [\n      // Setup support for ES6\n      {\n        test: /\\.(jsx?|es6)$/,\n        exclude: /node_modules/,\n        loader: 'babel'\n      },\n      // Setup support for CSS Modules\n      {\n        test: /\\.css$/,\n        loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules\u0026importLoaders=1\u0026localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader')\n      }\n    ]\n  },\n  plugins: [\n    // Extract the css and put it in one file. Path is relative to output path\n    new ExtractTextPlugin('../css/[name].css', { allChunks: true })\n  ],\n  // CSS Modules\n  postcss: [\n    require('postcss-nested'),\n    require('postcss-color-hex-alpha'),\n    require('postcss-color-function'),\n    require('postcss-calc'),\n    require('autoprefixer')\n  ],\n  [...]\n}\n```\n\n## Tests\n\n1. `npm install`\n2. `npm test`\n\n## History\n- 1.2.1 - Upgraded react-transition-group to 2.9.0.\n- 1.1.2 - Renamed prop to value.\n- 1.1.1 - Added initPressed prop; added pressed state to handleClick event target value.\n- 1.1.0 - Added support for sticky buttons\n- 1.0.2 - Fixed React dependencies (for React 16)\n- 1.0.1 - Switched to react-transition-group@1.x (for React 16); downgraded to babel-loader 6.x (for webpack)\n- 1.0.0 - Optimized the shouldComponentUpdate on checking the children prop\n- 0.4.1 - Added a blur when the user clicks the button. Fixed react deps\n- 0.4.0 - Replaced babel latest with env, updated travis node version, updated highlight-click\n- 0.3.0 - Added support for the follow a attributes: download, rel. Upgrade deps\n- 0.2.0 - Fixes Jest to pass all tests\n- 0.1.4 - Moved ship-components-* to dependencies\n- 0.1.3 - Updated devDependencies and broke tests...\n- 0.1.2 - Fixed css with wrapper\n- 0.1.1 - Fixed css issues and broken tests\n- 0.1.0 - Initial\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 SHIP\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fship-components%2Fship-components-buttons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fship-components%2Fship-components-buttons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fship-components%2Fship-components-buttons/lists"}