react-base-guide
Version:
react ui components
66 lines (45 loc) • 1.56 kB
Markdown
<code>npm i react-is styled-components react-base-guide --save</code>
<code>yarn add react-is styled-components react-base-guide</code>
[](http://85.143.172.24:11000/)
* the guide is made using styled-components and typescript
<code>
import React, { useState } = "react";
import styled, { ThemeProvider } from "styled-components";
import { themes } from "react-base-guide";
const Layout = () => {
const { theme, setTheme } = useState("default");
const CurrentTheme = themes[theme];
return (
<ThemeProvider theme={themes[theme]}>
{Your app}
</ThemeProvider>
)
};
</code>
two themes are now available (default and dark), but you can create your own
### components
<code>
import { Container, Label, Input, Datepicker //and more } from "react-base-guide";
<Input
label="Some input"
value={someValue}
onChange={e => handler(e.target.value)}
/>
</code>
<code>
import { ServerStyleSheet, StyleSheetManager } from "styled-components";
const sheet = new ServerStyleSheet();
// tags need to be added to html markup
const styleTags = sheet.getStyleElement();
const HtmlContent = <StyleSheetManager sheet={sheet.instance}>
{Your app}
</StyleSheetManager>
</code>
more complete documentation will come later