https://github.com/bloodyowl/reshowcase
A tool to create demos for your ReScript React components
https://github.com/bloodyowl/reshowcase
Last synced: 5 months ago
JSON representation
A tool to create demos for your ReScript React components
- Host: GitHub
- URL: https://github.com/bloodyowl/reshowcase
- Owner: bloodyowl
- Created: 2019-03-07T14:49:41.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2023-11-03T11:08:53.000Z (about 2 years ago)
- Last Synced: 2025-04-06T04:41:18.498Z (9 months ago)
- Language: ReScript
- Homepage: https://bloodyowl.github.io/reshowcase
- Size: 1.72 MB
- Stars: 57
- Watchers: 4
- Forks: 11
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
- awesome-list - reshowcase
README
# Reshowcase
> A tool to create demos for your ReScript React components

```rescript
open Reshowcase.Entry
// Create a demo
demo(({addCategory}) => {
addCategory("Title", ({addDemo}) => {
// Add an example
addDemo("normal", ({string}) =>
// Register "handles" from your JSX directly
{string("text", "hello")->React.string}
)
addDemo("font-size", ({string, int}) =>
Belt.Int.toString}px`
},
(),
)}>
{string("text", "hello")->React.string}
)
})
})
demo(({addCategory}) =>
addCategory("Button", ({addDemo}) =>
addDemo("normal", ({string, bool}) =>
{string("text", "hello")->React.string}
)
)
)
start()
```
## Install
```console
yarn add --dev reshowcase
```
Then add to your `"reshowcase"` to `bs-dependencies` in your `bsconfig.json`.
> If you're still using JSX 2, install `reshowcase@1.4.0`.
## Usage
### To start / develop:
```console
$ reshowcase start --entry=path/to/Demo.bs.js
```
### To build bundle:
```console
$ reshowcase build --entry=path/to/Demo.bs.js --output=path/to/bundle
```
If you need custom webpack options, create the `.reshowcase/config.js` and export the webpack config, plugins and modules will be merged.
If you need a custom template, pass `--template=./path/to/template.html`.