npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sagu-ui

v2.3.3

Published

It's a simple and faster React library

Downloads

16

Readme

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.