An open API service indexing awesome lists of open source software.

https://github.com/vczb/sagu-ui

It's a simple React UI
https://github.com/vczb/sagu-ui

hacktoberfest react storybook styled-components typescript

Last synced: 17 days ago
JSON representation

It's a simple React UI

Awesome Lists containing this project

README

        

![SAGU-UI](./logo.png)

It's a simple and faster React UI

## Installation πŸ› οΈ

sagu-ui is available as an [npm package](https://www.npmjs.com/package/sagu-ui).

To install it, run:

```bash
//with npm
npm install sagu-ui

//with yarn
yarn add sagu-ui
```

_[styled-components](https://github.com/styled-components/styled-components) package is required_

## Usage πŸ‘‡

Here is a quick example to get you started, **it's all you need**:

```js
import React from 'react'
import { theme, SaguGlobalStyles, SaguProvider, Button } from 'sagu-ui'

function App() {
return (


Click me

)
}

export default App
```

## Theme customization βœ’οΈ

You can easily override the values of the theme object

```js
import { theme, SaguProvider } from 'sagu-ui'

function App() {
Object.assign(theme.colors.primary, { medium: "#510763" });

return ...
}
```

Also you can add an entire custom object and it will be available on the Provider

```js
import { theme, SaguProvider } from 'sagu-ui'
import { CustomWrapper } from './components/CustomWrapper'

function App() {
const customColors = {
tertiary: {
lighter: "#fb973a",
light: "#e37c1d",
medium: "#da710f",
dark: "#9e4c01"
}
};

Object.assign(theme.colors, customColors);

return (

...

)
}
```

```js
// components/CustomWrapper.ts
import styled, { css } from 'styled-components'

export const CustomWrapper = styled.div`
${({ theme }) => css`
background: ${theme.colors.tertiary.medium};
`}
`
```

## Component customization πŸ”§

You have too many ways to customize the Sagu components

**Using styled-components**

```js
import styled from 'styled-components'
import { Button } from 'sagu-ui'

const MyCustomButton = styled(Button)`
background: red;
`
...

My Button
```

**Using inline styles**

```js
import { Button } from 'sagu-ui'

...

My Button

```

**Using CSS classes**

```css
.button-green {
background: green;
}
```

```js
import { Button } from 'sagu-ui'
import './styles.css'

...

My Button
```

## Examples ✍️

Take a look at some [examples](./EXAMPLES.md) using [Sagu-UI](https://www.npmjs.com/package/sagu-ui)

## Contributing 🀝

You can contribute to this project by opening an issue or creating a pull request.

## What is inside❓

- [TypeScript](https://www.typescriptlang.org/)
- [Styled Components](https://styled-components.com/)
- [Storybook](https://storybook.js.org/)
- [Eslint](https://eslint.org/)
- [Prettier](https://prettier.io/)
- [Jest](https://jestjs.io/)

## Available commands ⬇️

- `build`: build the files in the `lib` directory
- `sb`: run the storybook at the address `localhost:6006`
- `prettier:check`: check formatting on all `src` directory
- `prettier:format`: formats all `src` directory
- `generate `: create a component boilerplate
- `test`: test all components

## Project structure 🧬

```
/.storybook
/lib
/src
β”œβ”€β”€ index.ts
β”œβ”€β”€ animations
| β”œβ”€β”€ placeholder.ts
β”œβ”€β”€ hooks
| β”œβ”€β”€ ...
β”œβ”€β”€ packages
| β”œβ”€β”€ index.ts
| β”œβ”€β”€ Button
| | β”œβ”€β”€ index.tsx
| | β”œβ”€β”€ stories.tsx
| | └── styles.ts
| | └── test.tsx
β”œβ”€β”€ styles
| β”œβ”€β”€ global.ts
| β”œβ”€β”€ theme.ts
| β”œβ”€β”€ provider.ts
```
## Our Amazing Contributors 🌟
Thanks for all who is contributing with us.



Be part of this amazing team, [contribute](./CONTRIBUTING.md) as well

## License πŸ“œ

This project is licensed under the [MIT](./LICENSE) License.