{"id":13422018,"url":"https://github.com/tkwant/react-steps","last_synced_at":"2025-03-15T10:31:36.606Z","repository":{"id":57166787,"uuid":"417268538","full_name":"tkwant/react-steps","owner":"tkwant","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-13T07:54:08.000Z","size":339,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-12T19:02:56.053Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tkwant.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":"2021-10-14T20:09:28.000Z","updated_at":"2024-09-06T22:35:18.000Z","dependencies_parsed_at":"2022-08-30T15:21:45.182Z","dependency_job_id":null,"html_url":"https://github.com/tkwant/react-steps","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkwant%2Freact-steps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkwant%2Freact-steps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkwant%2Freact-steps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkwant%2Freact-steps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkwant","download_url":"https://codeload.github.com/tkwant/react-steps/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243277502,"owners_count":20265351,"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":[],"created_at":"2024-07-30T23:00:35.619Z","updated_at":"2025-03-15T10:31:35.979Z","avatar_url":"https://github.com/tkwant.png","language":"TypeScript","readme":"# React Stepper\n\nReact Stepper which can also be used on mobile devices\n\nNpm Package:\nhttps://www.npmjs.com/package/@tkwant/react-steps\n\nDemo:\nhttps://stepper.tkwant.de\n\n![image](https://github.com/tkwant/react-steps/blob/main/demo.gif)\n\n## Installation\n\n```\nyarn add @tkwant/react-steps\n```\n\n```\nnpm i @tkwant/react-steps\n```\n\n## Usage\n\n```\nimport React, { useState } from \"react\";\nimport { Stepper, Step } from \"@tkwant/react-steps\";\ninterface Props {}\nconst App: React.FC\u003cProps\u003e = () =\u003e {\n  const [curStep, setCurStep] = useState(0);\n  const [step2Data, setStep2Data] = useState(\"\");\n  const renderContent = () =\u003e {\n    switch (curStep) {\n      case 0:\n        return (\n          \u003cdiv style={{ display: \"flex\", justifyContent: \"center\" }}\u003e\n            First Step\n          \u003c/div\u003e\n        );\n      case 1:\n        return (\n          \u003cdiv style={{ display: \"flex\", justifyContent: \"center\" }}\u003e\n            \u003cp style={{ marginRight: 2 }}\u003eMy Validation: \u003c/p\u003e\n            \u003cinput\n              style={{ border: \"2px solid red\" }}\n              onChange={(e) =\u003e setStep2Data(e.currentTarget.value)}\n              value={step2Data}\n            /\u003e\n          \u003c/div\u003e\n        );\n      default:\n        return null;\n    }\n  };\n\n  return (\n    \u003c\u003e\n      \u003cStepper\n        style={{ padding: 10 }}\n        curStep={curStep}\n        setCurStep={setCurStep}\n      \u003e\n        \u003cStep label=\"Step 0 \" /\u003e\n        \u003cStep label=\"Step 1\" /\u003e\n        \u003cStep locked={step2Data === \"\"}\u003e??\u003c/Step\u003e\n        \u003cStep locked={curStep \u003c 2} /\u003e\n        \u003cStep locked={curStep \u003c 3} /\u003e\n        \u003cStep locked={curStep \u003c 4} /\u003e\n        \u003cStep locked={curStep \u003c 5} /\u003e\n      \u003c/Stepper\u003e\n      {renderContent()}\n    \u003c/\u003e\n  );\n};\n\nexport default App;\n```\n\n## Stepper Props\n\n| Prop                       | Description | Default     |\n| -------------------------- | ----------- | ----------- |\n| children                   |             |\n| curStep                    |             |\n| setCurStep                 |             |\n| className                  | optional    | \"\"          |\n| activeColor                | optional    | \"#0b294b\"   |\n| inActiveColor              | optional    | \"#D1D5DB\"   |\n| borderColor                | optional    | \"#8fb3db\"   |\n| stepSize                   | optional    | 60          |\n| progressBarActiveColor     | optional    | \"green\"     |\n| progressBarBackgroundColor | optional    | \"lightgray\" |\n| smallScreenShowProgressbar | optional    | true        |\n| style                      | optional    | {}          |\n\n## Step Props\n\n| Prop     | Description | Default       |\n| -------- | ----------- | ------------- |\n| children | optional    | current Index |\n| label    | optional    | \"\"            |\n| locked   | optional    | false         |\n","funding_links":[],"categories":["UI Components"],"sub_categories":["Paginator"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkwant%2Freact-steps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkwant%2Freact-steps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkwant%2Freact-steps/lists"}