# sagu-ui

> It's a simple and faster React library

Latest version **2.3.3** (published 2024-03-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install sagu-ui
pnpm add sagu-ui
yarn add sagu-ui
bun add sagu-ui
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.3 |
| Published | 2024-03-10 |
| First published | 2021-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 713.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Author | vczb |
| Maintainers | vczb |
| Keywords | React, UI, Components |

## Links

- npm: https://www.npmjs.com/package/sagu-ui
- Repository: https://github.com/vczb/sagu-ui
- Homepage: https://vczb.github.io/sagu-ui
- Issues: https://github.com/vczb/sagu-ui/issues
- npm.io page: https://npm.io/package/sagu-ui

## Alternatives

- [@progress/kendo-ooxml](https://npm.io/package/@progress/kendo-ooxml.md) — 152.1K weekly downloads
- [@progress/kendo-react-ripple](https://npm.io/package/@progress/kendo-react-ripple.md) — 8.0K weekly downloads
- [@progress/kendo-react-orgchart](https://npm.io/package/@progress/kendo-react-orgchart.md) — 4.3K weekly downloads
- [@praxisui/dynamic-fields](https://npm.io/package/@praxisui/dynamic-fields.md) — 2.4K weekly downloads
- [@progress/kendo-vue-listbox](https://npm.io/package/@progress/kendo-vue-listbox.md) — 932 weekly downloads

## Recent versions

- 2.3.3 (latest) — 2024-03-10
- 2.3.2 — 2024-03-02
- 2.3.1 — 2023-11-11
- 2.3.0 — 2023-11-10
- 2.2.4 — 2023-11-06
- 2.2.3 — 2023-11-06
- 2.2.2 — 2023-11-06
- 2.2.1 — 2023-11-05
- 2.2.0 — 2023-11-05
- 2.1.7 — 2023-06-23
- 2.1.6 — 2023-06-23
- 2.1.5 — 2023-06-23
- 2.1.4 — 2023-06-23
- 2.1.3 — 2023-06-23
- 2.1.2 — 2023-06-23
- … 40 more at https://npm.io/package/sagu-ui/versions

## 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 (
    <SaguProvider theme={theme}>
      <SaguGlobalStyles />
      <Button>Click me</Button>
    </SaguProvider>
  )
}

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 <SaguProvider theme={theme}>...</SaguProvider>
}
```

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 (
    <SaguProvider theme={theme}>
      <CustomWrapper>...</CustomWrapper>
    </SaguProvider>
  )
}
```

```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;
`
...

<MyCustomButton>My Button</MyCustomButton>
```

**Using inline styles**

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

...

<Button
  style={{
    background: 'yellow'
  }}
>
  My Button
</Button>
```

**Using CSS classes**

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

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

...

<Button className="button-green">My Button</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 <Component name>`: 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.

<a href="https://github.com/vczb/sagu-ui/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=vczb/sagu-ui" />
</a>

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

## License 📜

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

---
_Source: https://npm.io/package/sagu-ui · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
