Let's build interactive & sound CLI with React and ReScript!
Core:
- [x] render
- [x] ref & measureElement
Components:
- [x] Box
- [x] Text
- [x] Newline
- [x] Spacer
- [x] Static
- [x] Transform
Hooks:
- [x] useApp
- [x] useInput
- [x] useFocus
- [x] useFocusManager
- [x] useStdin
- [x] useStdout
- [x] useStderr
Do you find any missing APIs? Let me know!
- @rescript-ink/ink-big-text (ink-big-text)
- @rescript-ink/ink-spinner (ink-spinner)
- @rescript-ink/ink-text-input (ink-text-iput)
- @rescript-ink/ink-link (ink-link)
- Ink v3.0.0 or higher
- ReScript v9.1.0 or higher
yarn add rescript-ink @rescript/react \
# You can install additional community bindings \
@reason-ink/ink-big-text
Add it to your bsconfig.json
"bs-dependencies": [
+ "rescript-ink",
+ "@rescript/react",
+ "@reason-ink/ink-big-text
]
open Ink;
// Community bindings have `InkCommunity_` prefix.
module BigText = InkCommunity_BigText;
module App = {
@react.component
let make = () => {
<Box display=#flex justifyContent=#center>
<BigText text="Hello, Reason-Ink!"/>
</Box>
};
};
let {waitUntilExit} = render(<App />, ~exitOnCtrlC=true, ());
waitUntilExit()->ignore;
See more in examples
Any feedbacks & contributions are welcome!
See more details in CONTRIBUTING
MIT