{"id":17659748,"url":"https://github.com/raphamorim/reactsandbox","last_synced_at":"2025-06-18T13:41:27.672Z","repository":{"id":57348440,"uuid":"114046826","full_name":"raphamorim/reactsandbox","owner":"raphamorim","description":"Create a React Component Sandboxes based on compositions","archived":false,"fork":false,"pushed_at":"2018-01-26T21:57:46.000Z","size":682,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-02T21:11:28.850Z","etag":null,"topics":["documentation","documentation-tool","react-components","reactjs","sandbox","storybook"],"latest_commit_sha":null,"homepage":"http://raphamorim.io/reactsandbox/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raphamorim.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-12-12T22:41:58.000Z","updated_at":"2021-09-13T14:39:56.000Z","dependencies_parsed_at":"2022-09-12T03:20:33.889Z","dependency_job_id":null,"html_url":"https://github.com/raphamorim/reactsandbox","commit_stats":null,"previous_names":["raphamorim/resandbox","raphamorim/react-sandbox"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphamorim%2Freactsandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphamorim%2Freactsandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphamorim%2Freactsandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphamorim%2Freactsandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphamorim","download_url":"https://codeload.github.com/raphamorim/reactsandbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242980783,"owners_count":20216283,"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":["documentation","documentation-tool","react-components","reactjs","sandbox","storybook"],"created_at":"2024-10-23T16:08:11.057Z","updated_at":"2025-03-11T05:33:16.822Z","avatar_url":"https://github.com/raphamorim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reactsandbox\n\n[![CircleCI](https://circleci.com/gh/raphamorim/reactsandbox/tree/master.svg?style=svg)](https://circleci.com/gh/raphamorim/reactsandbox/tree/master)\n\n\u003e Create a React Component Sandbox based on compositions\n\nIntegrate Live documentation on real-world React components.\n\nReasons to use `reactsandbox`:\n\n- Fully Hackable (you can change everthing or create your own style, see [available CSS classes](https://github.com/raphamorim/reactsandbox/blob/master/styles/reactsandbox.css)).\n\n- You can use with any Builder (Webpack, Rollup, Browserify, Parcel...). Because `reactsanbox` is only a HOC.\n\n- Easy to add on existent component and fast update on documentation, it can be used with `PropTypes` or `Types`.\n\n- Lightweight `~3.6K gzip`.\n\n![Example](assets/example.gif)\n\n## Installing\n\n```bash\nyarn add reactsandbox\n```\n\n## Example\n\n**Book.js**\n\n```jsx\nimport React from 'react'\nimport withSandbox, { Types } from 'reactsandbox'\n\n// you can import styles or create your own\nimport 'reactsandbox/styles/default-theme.css'\n\nconst Book = ({title, author, year, transparent, renderCover}) =\u003e\n  \u003cdiv className={`book ${(transparent)? 'transparent' : ''}`}\u003e\n    \u003cdiv className='cover'\u003e{renderCover}\u003c/div\u003e\n    \u003cdiv className='info'\u003e\n      \u003cdiv className='title'\u003e{title}\u003c/div\u003e\n      \u003cdiv className='author'\u003e{author}\u003c/div\u003e\n      \u003cdiv className='year'\u003e{year}\u003c/div\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\n// Compose Sandbox for Book Component\nconst BookSandbox = withSandbox(Book, {\n  transparent: Types.Boolean(false, 'Set Book Card as Transparent'),\n  title: Types.String('My Book Name', 'Description of Title'),\n  author: Types.String('John Doe', 'Description of Author'),\n  year: Types.Number(1995, 'Year of Publication'),\n  renderCover: Types.ReactElement('\u003cimg src=\"book-cover.jpg\"/\u003e', 'Render ReactElement as Cover Book')\n})\n\nexport default Book\nexport BookSandbox // export Component Sandbox either\n```\n\n[See Demo](http://raphamorim.io/reactsandbox/)\n\n## Types\n\nNote that `Type` is a custom object, then you can create your own.\n\n### Custom Types\n\n#### Boolean\n\nReturns Type object from Boolean.\n\n**default value**: `false`\n\n```jsx\nTypes.Boolean(false, 'prop description')\n```\n\n#### String\n\nReturns Type object from String.\n\n**default value**: `''`\n\n```jsx\nTypes.String('prop value', 'prop description')\n```\n\n#### Number\n\nReturns Type object from Number.\n\n**default value**: `0`\n\n```jsx\nTypes.String(100, 'prop description')\n```\n\n#### ReactElement (not stable, experimental)\n\nReturns Type object from ReactElement.\n\n**default value**: `null`\n\n```jsx\nTypes.ReactElement('\u003cimg src=\"source-to-my-image.png\"/\u003e', 'prop description')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphamorim%2Freactsandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphamorim%2Freactsandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphamorim%2Freactsandbox/lists"}