Giter Club home page Giter Club logo

sagu-ui's Introduction

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() {
  const customTheme = Object.assign(theme)

  customTheme.colors.primary.medium = '#510763'

  return <SaguProvider theme={customTheme}>...</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 customTheme = Object.assign(theme)

  customTheme.colors.tertiary = {
    lighter: '#fb973a',
    light: '#e37c1d',
    medium: '#da710f',
    dark: '#9e4c01'
  }

  return (
    <SaguProvider theme={customTheme}>
      <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.

sagu-ui's People

Contributors

vczb avatar anechol avatar maemreyo avatar shinji22 avatar kushalnerella07 avatar balastrong avatar siddarthpai avatar yvillamilrccl avatar amitkroutthedev avatar shailendra1703 avatar shlok-2003 avatar sakana7 avatar amitkumar-y avatar ksj14-kumar avatar romw314 avatar sai-karthik-p avatar uchihaweb3 avatar yash6318 avatar pubhargavi avatar kiruthikajeyashankar avatar keerthanak-tw avatar geekyharsh05 avatar divyesh1511 avatar dev-shetty avatar aalmeida00 avatar printf-ana avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.