- Notifications
You must be signed in to change notification settings - Fork13
Write interactive CLI apps with React
License
NotificationsYou must be signed in to change notification settings
zamotany/react-slate
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Write interactive CLI apps with React
Package | Description | Version |
---|---|---|
@react-slate/core | The core functionality and logic. |
https://zamotany.github.io/react-slate/
- Render React apps to:
- terminal with
render
- terminal in fullscreen mode with
renderFullscreen
- a string with
renderToString
- a JSON tree
renderToJson
- terminal with
- Use
for await
to continuously render your app usingrenderToString
orrenderToJson
. - Render your app to alternative screen buffer and go back to the previous content upon exit with
renderFullscreen
. - Log messages to main screen buffer with
console
when exiting when in fullscreen mode (renderFullscreen
). - Build layouts with FlexBox (https://github.com/vislyhq/stretch).
- Disable colors with
NO_COLOR
environment variable. - Use standard ANSI colors, RBG, Hex and CSS keywords to style your app.
- Use built-in
<Progress />
and<Spinner />
components. - Get layout information using
onLayout
prop. - Handle clicks using
onClick
prop. - Detect mouse wheel events using
onWheel
prop. - Support for absolute positioning and depth (
zIndex
). - Built with TypeScript.
Please check outRoadmap for in-progress and planned features.
- Web components are not compatible.
- Strings must be wrapped in a
<Text>
component.
yarn add react @react-slate/core
importReactfrom'react';import{render,View,Text}from'@react-slate/core';functionApp(){return(<Viewwidth="100%"flexDirection="row"justifyContent="center"><Textcolor="green"bold>Hello world!</Text></View>);}render(<App/>);
About
Write interactive CLI apps with React
Topics
Resources
License
Code of conduct
Stars
Watchers
Forks
Packages0
No packages published