{"id":15916827,"url":"https://github.com/nozzlegear/react-win-pivot","last_synced_at":"2026-05-09T00:32:11.507Z","repository":{"id":57132103,"uuid":"80159754","full_name":"nozzlegear/react-win-pivot","owner":"nozzlegear","description":"An attempt to recreate the Pivot element from WinJS in React.","archived":false,"fork":false,"pushed_at":"2022-03-11T20:17:19.000Z","size":108,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-10T17:03:31.163Z","etag":null,"topics":["react","uwp","windows","winjs"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/nozzlegear.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":"2017-01-26T21:59:38.000Z","updated_at":"2022-02-28T03:15:26.000Z","dependencies_parsed_at":"2022-09-03T11:41:23.488Z","dependency_job_id":null,"html_url":"https://github.com/nozzlegear/react-win-pivot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nozzlegear%2Freact-win-pivot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nozzlegear%2Freact-win-pivot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nozzlegear%2Freact-win-pivot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nozzlegear%2Freact-win-pivot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nozzlegear","download_url":"https://codeload.github.com/nozzlegear/react-win-pivot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246991152,"owners_count":20865601,"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":["react","uwp","windows","winjs"],"created_at":"2024-10-06T18:05:09.774Z","updated_at":"2026-05-09T00:32:06.475Z","avatar_url":"https://github.com/nozzlegear.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @nozzlegear/react-win-pivot\n\n![Screeshot of react-win-pivot](./assets/example.png)\n\n## Installation\n\nWith [Yarn](https://github.com/yarnpkg/yarn):\n\n```shell\nyarn install @nozzlegear/react-win-pivot\n```\n\nOr from [NPM](https://npmjs.com/package/@nozzlegear/react-win-pivot):\n\n```shell\nnpm install @nozzlegear/react-win-pivot --save\n```\n\n## Importing\n\nImport the component via ES6 import:\n\n```js\nimport { Pivot } from \"@nozzlegear/react-win-pivot\";\n// or use default import\nimport Pivot from \"@nozzlegear/react-win-pivot\";\n```\n\n## Example\n\n```tsx\nimport * as React from \"react\";\nimport { Pivot } from \"../index\";\n\ntype Tab = \"First Tab\" | \"Second Tab\" | \"Third Tab\";\n\nconst DEFAULT_TABS: Tab[] = [\n    \"First Tab\",\n    \"Second Tab\",\n    \"Third Tab\",\n]\n\nfunction MyPivotComponent(): JSX.Element {\n    const [selectedTab, setSelectedTab] = React.useState(DEFAULT_TABS[0]);\n\n    return (\n        \u003cPivot animate={true} tabs={DEFAULT_TABS} selectedTab={selectedTab} onChange={setSelectedTab}\u003e\n            \u003cdiv\u003e\n                \u003ch1\u003e{`This is the ${selectedTab}.`}\u003c/h1\u003e\n            \u003c/div\u003e\n        \u003c/Pivot\u003e\n    )\n}\n```\n\n## Props\n\nNote: This package has full TypeScript definitions! You should automatically receive intellisense for all of the props documented below:\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `animate` | `boolean` | Required | Indicates that the pivot should animate when it renders and each time the selected tab changes. |\n| `animationDuration?` | `number` | Optional, default `200` | The duration of the animation in milliseconds. Only used when `animate` is true. |\n| `tabs` | `string[]` | Required | An array of strings to be used as the name of the tabs, e.g. `\"Tab 1\", \"Tab 2\"`. |\n| `selectedTab` | `string` | Required | The currently selected tab. Must be one of the string values from `tabs`. |\n| `onChange` | `(newTab: string) =\u003e void` | Required | A function that's called when the user attempts to change the selected tab. Note that this is only a notification that the user wants to change the tab, it will not change itself. |\n| `children` | `React.ReactNode` | Required | Content to show in the Pivot's content area. |\n\n## Styling\n\nIf you'd like to style the Pivot components yourself, you can change the following CSS variables with your own stylesheet:\n\n| Name | Default value |\n| ---- | ------------- |\n| `--pivot-tabs-font-family` | `inherit` |\n| `--pivot-tabs-font-size` | `24px` |\n| `--pivot-tabs-font-color` | `rgba(0,0,0,.6)` |\n| `--pivot-tabs-active-font-color` | `#000` |\n| `--pivot-tabs-padding` | `20px 20px 20px 0` | \n| `--pivot-tabs-column-gap` | `20px` |\n| `--pivot-tabs-border-width` | `0 0 1px 0` |\n| `--pivot-tabs-border-style` | `solid` |\n| `--pivot-tabs-border-color` | `#ccc` |\n| `--pivot-tabs-content-padding` | `0` |\n| `--pivot-tabs-slide-in-start-opacity` | `0` |\n| `--pivot-tabs-slide-in-end-opacity` | `1` |\n| `--pivot-tabs-slide-in-transition` | `all 0.1s ease-in-out` |\n| `--pivot-tabs-slide-in-transform` | `translate(0, 0)` |\n| `--pivot-tabs-slide-in-from-left-transform` | `translate(-100px, 0px)` |\n| `--pivot-tabs-slide-in-from-right-transform` | `translate(100px, 0px)` |\n| `--pivot-tabs-slide-in-from-below-transform` | `translate(0px, 100px)` |\n\nExample:\n\n```css\n.react-win-pivot {\n    /* Change the padding of the tabs list */\n    --pivot-tabs-padding: 40px 0;\n    /* Change the css transition for animated tabs */\n    --pivot-tabs-slide-in-transition: all 0.15s linear;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnozzlegear%2Freact-win-pivot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnozzlegear%2Freact-win-pivot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnozzlegear%2Freact-win-pivot/lists"}