2.3.3 β€’ Published 2 months ago

sagu-ui v2.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

SAGU-UI

It's a simple and faster React UI

Installation πŸ› οΈ

sagu-ui is available as an npm package.

To install it, run:

  //with npm
  npm install sagu-ui

  //with yarn
  yarn add sagu-ui

styled-components package is required

Usage πŸ‘‡

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

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

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

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>
  )
}
// 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

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

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

<MyCustomButton>My Button</MyCustomButton>

Using inline styles

import { Button } from 'sagu-ui'

...

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

Using CSS classes

.button-green {
  background: green;
}
import { Button } from 'sagu-ui'
import './styles.css'

...

<Button className="button-green">My Button</Button>

Examples ✍️

Take a look at some examples using Sagu-UI

Contributing 🀝

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

What is inside❓

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.

Be part of this amazing team, contribute as well

License πŸ“œ

This project is licensed under the MIT License.

2.3.3

2 months ago

2.3.2

2 months ago

2.2.1

6 months ago

2.2.0

6 months ago

2.2.3

6 months ago

2.2.2

6 months ago

2.2.4

6 months ago

2.3.0

6 months ago

2.3.1

6 months ago

2.1.2

11 months ago

2.1.1

11 months ago

2.1.4

11 months ago

2.1.3

11 months ago

2.1.6

11 months ago

2.1.5

11 months ago

2.0.9

11 months ago

2.1.7

11 months ago

2.1.0

11 months ago

2.0.8

2 years ago

2.0.5

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

1.1.8-alpha

2 years ago

1.1.12-alpha

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.4

2 years ago

1.1.17-alpha

2 years ago

1.1.15-alpha

2 years ago

2.0.1

2 years ago

1.1.10-alpha

2 years ago

1.1.11-alpha

2 years ago

1.1.13-alpha

2 years ago

1.1.18-alpha

2 years ago

1.1.9-alpha

2 years ago

1.1.14-alpha

2 years ago

1.1.16-alpha

2 years ago

1.1.8

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.1.7

3 years ago

1.0.8

3 years ago

1.1.6

3 years ago

1.0.7

3 years ago

1.1.5

3 years ago

1.0.6

3 years ago

1.1.4

3 years ago

1.0.5

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

2.0.0

3 years ago

1.0.1

3 years ago