{"id":13670787,"url":"https://github.com/bmcmahen/react-cube-navigation","last_synced_at":"2025-04-14T05:09:35.966Z","repository":{"id":35061972,"uuid":"201530780","full_name":"bmcmahen/react-cube-navigation","owner":"bmcmahen","description":"3d cube style navigation pattern, like that found in Instagram Stories","archived":false,"fork":false,"pushed_at":"2022-12-11T01:32:01.000Z","size":6613,"stargazers_count":59,"open_issues_count":29,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T05:09:30.967Z","etag":null,"topics":["cube","gesture","navigation"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/embed/react-cube-navigation-example-gngpz","language":"TypeScript","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/bmcmahen.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":"2019-08-09T19:44:42.000Z","updated_at":"2023-04-19T06:28:55.000Z","dependencies_parsed_at":"2022-08-29T05:53:24.421Z","dependency_job_id":null,"html_url":"https://github.com/bmcmahen/react-cube-navigation","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmcmahen%2Freact-cube-navigation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmcmahen%2Freact-cube-navigation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmcmahen%2Freact-cube-navigation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmcmahen%2Freact-cube-navigation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmcmahen","download_url":"https://codeload.github.com/bmcmahen/react-cube-navigation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248824681,"owners_count":21167345,"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":["cube","gesture","navigation"],"created_at":"2024-08-02T09:00:49.540Z","updated_at":"2025-04-14T05:09:35.937Z","avatar_url":"https://github.com/bmcmahen.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# react-cube-navigation\n\nReact Cube Navigation provides an animated cube style navigation pattern like that found in Instagram stories.\n\n[Demo on CodeSandbox](https://codesandbox.io/embed/react-cube-navigation-example-gngpz)\n\n## Features\n\n- Render an infinite number of panes\n- Gesture based controls\n- Spring based animations\n\n## Install\n\nInstall `react-cube-navigation` and its peer dependencies `react-gesture-responder` and `react-spring` using yarn or npm.\n\n```\nyarn add react-cube-navigation react-gesture-responder react-spring\n```\n\n## Basic usage\n\n```jsx\nimport Cube from \"react-cube-navigation\";\n\nconst images = [\n  \"https://images.unsplash.com/photo-1565371557106-c2abcc6fb36a?ixlib=rb-1.2.1\u0026ixid=eyJhcHBfaWQiOjEyMDd9\u0026auto=format\u0026fit=crop\u0026w=634\u0026q=80\",\n  \"https://images.unsplash.com/photo-1565361849078-294849288ced?ixlib=rb-1.2.1\u0026ixid=eyJhcHBfaWQiOjEyMDd9\u0026auto=format\u0026fit=crop\u0026w=634\u0026q=80\",\n  \"https://images.unsplash.com/photo-1565279799937-b397e6483124?ixlib=rb-1.2.1\u0026ixid=eyJhcHBfaWQiOjEyMDd9\u0026auto=format\u0026fit=crop\u0026w=619\u0026q=80\",\n  \"https://images.unsplash.com/photo-1565264216052-3c9012481a1f?ixlib=rb-1.2.1\u0026ixid=eyJhcHBfaWQiOjEyMDd9\u0026auto=format\u0026fit=crop\u0026w=634\u0026q=80\",\n  \"https://images.unsplash.com/photo-1565274952013-13cecde5c8b1?ixlib=rb-1.2.1\u0026ixid=eyJhcHBfaWQiOjEyMDd9\u0026auto=format\u0026fit=crop\u0026w=634\u0026q=80\",\n  \"https://images.unsplash.com/photo-1565287753977-e94d0227c640?ixlib=rb-1.2.1\u0026ixid=eyJhcHBfaWQiOjEyMDd9\u0026auto=format\u0026fit=crop\u0026w=633\u0026q=80\",\n  \"https://images.unsplash.com/photo-1565340076861-7a6667b36072?ixlib=rb-1.2.1\u0026ixid=eyJhcHBfaWQiOjEyMDd9\u0026auto=format\u0026fit=crop\u0026w=700\u0026q=80\",\n  \"https://images.unsplash.com/photo-1565259901762-b8d797c6f887?ixlib=rb-1.2.1\u0026ixid=eyJhcHBfaWQiOjEyMDd9\u0026auto=format\u0026fit=crop\u0026w=634\u0026q=80\"\n];\n\nfunction Example() {\n  const [index, setIndex] = React.useState(0);\n\n  return (\n    \u003cCube\n      index={index}\n      onChange={i =\u003e setIndex(i)}\n      width={300}\n      height={600}\n      hasNext={i =\u003e i \u003c images.length - 1}\n      renderItem={(i, active) =\u003e {\n        return (\n          \u003cdiv\n            style={{\n              backgroundImage: `url(${images[i]})`,\n              backgroundSize: \"cover\",\n              flex: 1,\n              borderRadius: \"1rem\"\n            }}\n          /\u003e\n        );\n      }}\n    /\u003e\n  );\n}\n```\n\n## API\n\n### Cube\n\n| Name          | Type                                             | Default Value | Description                                                                                             |\n| ------------- | ------------------------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------- |\n| renderItem \\* | (i: number, active: boolean) =\u003e React.ReactNode; |               | A callback to render cube panes                                                                         |\n| onChange \\*   | (i: number) =\u003e void;                             |               | A callback to update the current index                                                                  |\n| index \\*      | number \\|{ index: number, immediate: boolean}    |               | The index to render. Optionally pass an object with an index and immediate property to skip animations. |\n| hasNext       | (i: number) =\u003e boolean                           | true          | Whether another pane exists after the provided index                                                    |\n| width         | number                                           | 200           | The width of the cube in pixels                                                                         |\n| height        | number                                           | 600           | The height of the cube in pixels                                                                        |\n| perspective   | number                                           | 1200          | The perspective of the cube in pixels                                                                   |\n| paneStyle     | React.CSSProperties                              |               | Pane container styles                                                                                   |\n| scaleRange    | [number, number]                                 | [1, 0.95]     | The scale range to shrink the cube when swiping                                                         |\n| lockScrolling | boolean                                          | false         | Lock all page scrolling                                                                                 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmcmahen%2Freact-cube-navigation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmcmahen%2Freact-cube-navigation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmcmahen%2Freact-cube-navigation/lists"}