{"id":26042674,"url":"https://github.com/nstr/react-tab-list","last_synced_at":"2025-04-10T05:40:29.998Z","repository":{"id":57346117,"uuid":"81011564","full_name":"nstr/react-tab-list","owner":"nstr","description":"Special react component for menu, filters and etc.","archived":false,"fork":false,"pushed_at":"2018-03-18T13:41:13.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T06:54:36.334Z","etag":null,"topics":["es6","javascript","react","react-component","reactjs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-tab-list","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/nstr.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-02-05T18:12:37.000Z","updated_at":"2018-06-19T08:58:50.000Z","dependencies_parsed_at":"2022-09-17T22:50:38.851Z","dependency_job_id":null,"html_url":"https://github.com/nstr/react-tab-list","commit_stats":null,"previous_names":["njnest/react-tab-list"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nstr%2Freact-tab-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nstr%2Freact-tab-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nstr%2Freact-tab-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nstr%2Freact-tab-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nstr","download_url":"https://codeload.github.com/nstr/react-tab-list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166120,"owners_count":21058474,"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":["es6","javascript","react","react-component","reactjs"],"created_at":"2025-03-07T16:44:11.995Z","updated_at":"2025-04-10T05:40:29.971Z","avatar_url":"https://github.com/nstr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-tab-list\n* [Installation](#installation)\n* [Simple usage](#simple-usage)\n* [Active tab](#active-tab)\n* [Styles](#styles)\n\n![demo](https://s3-eu-west-1.amazonaws.com/njnest-opensource/npm/tab-list.gif)\n\n## Installation\n\n```\nnpm i react-tab-list\n```\n\n## Simple usage: \n\n\n```jsx\nimport TabList from \"react-tab-list\";\n\nconst items = [\n   {\n     name: \"First\"\n   },\n   {\n     name: \"Second\"\n   },\n   {\n     name: \"Third\"\n   }\n];\n\nclass SomeComponent extends React.Component{\n  constructor(props) {\n    super(props);\n  {\n  callBackFunction(tab) {\n    // There will be the active tab data\n  }\n  render() {\n    return \u003cTabList tabs={items} onTab={this.callBackFunction}/\u003e;\n  }\n}\n```\n\n\n## Active tab\n\n```jsx\nimport TabList from \"react-tab-list\";\nclass SomeComponent extends React.Component{\n  constructor(props) {\n    super(props);\n    this.state = {\n      items: [\n         {\n           name: \"First\",\n           id: \"a1\"\n         },\n         {\n           name: \"Second\",\n           id: \"b2\"\n         },\n         {\n           name: \"Third\",\n           id: \"e5\"\n         }\n      ],\n      activeTabId: \"b2\"\n    }\n    this.callBackFunction = this.callBackFunction.bind(this);\n  {\n  callBackFunction(tab) {\n    this.setState({activeTabId: tab.id});\n  }\n  render() {\n    return \u003cTabList tabs={this.state.items} \n            activeTab={{id: this.state.activeTabId}} \n            onTab={this.callBackFunction}/\u003e;\n  }\n}\n```\nOf course, you have the possibility not point an active tab(activeTab). In this case, the first item of tabs is assigned by default.\n\n\n## Styles:\n\nYou can include less, scss or css file in your project.\n\n```less\n@import \"./react-tab-list/styles/tab-list.less\";\n``` \n\n```scss\n@import \"./react-tab-list/styles/tab-list.scss\";\n``` \n\nand/or add some custome style:\n\n```jsx\n\u003cTabList tabs={[\n   {\n      name: \"Item 1\",\n      className: \"my-css-class\"\n   },\n   {\n      name: \"Item 2\",\n      className: \"my-css-class\"\n   }\n]} /\u003e;\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnstr%2Freact-tab-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnstr%2Freact-tab-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnstr%2Freact-tab-list/lists"}