1
Fork 0
mirror of https://github.com/Steffo99/bluelib.git synced 2024-10-16 13:47:28 +00:00
bluelib/README.md

47 lines
1.1 KiB
Markdown
Raw Normal View History

2021-08-24 11:35:12 +00:00
# `bluelib-react`
2022-03-12 03:11:30 +00:00
React bindings for [`bluelib@4`](https://github.com/Steffo99/bluelib)
2021-08-24 11:35:12 +00:00
## Documentation
2021-08-24 11:35:12 +00:00
An interactive documentation for `bluelib-react` is available [here](http://gh.steffo.eu/bluelib-react/), built using [Storybook](https://storybook.js.org/).
2021-08-24 11:35:12 +00:00
## Installation
2021-08-28 10:49:01 +00:00
You can download `bluelib-react` using your favourite node package manager:
```console
$ npm install --save @steffo/bluelib-react
```
```console
$ yarn add @steffo/bluelib-react
```
Ensure you have `react` and `react-dom` installed, as they are peer dependencies of this package and aren't installed automatically.
2021-08-24 11:35:12 +00:00
## Usage
2021-08-28 10:49:01 +00:00
You can import the components you want to use using the ES6 import syntax:
```js
import { Box } from "@steffo/bluelib-react"
```
**All** Bluelib components must be **inside a `<Bluelib>` container** for them to work correctly!
```jsx
import { Bluelib, Heading, Box } from "@steffo/bluelib-react"
const MyComponent = props => (
<Bluelib theme={"royalblue"}>
<Heading level={1}>
Hello world!
</Heading>
<Box>
Welcome to Bluelib!
</Box>
</Bluelib>
)
```