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

nen-ui

v0.1.7

Published

A customizable react button component with different style variants and support for light and dark mode

Downloads

70

Readme

nen-ui

A customizable react button component with different style variants and support for light and dark mode

Installing Nen UI

npm i nen-ui

or

yarn add nen-ui

Usage

To start using the components, please follow these steps:

import { ThemeProvider } from "styled-components";
import { light } from "nen-ui";
import { Button } from "nen-ui"
.
.
.
<ThemeProvider theme={ light }>
    <Button {...args} />
</ThemeProvider>

Examples

    <Button variant="primary" size="lg">Primary Button</Button>

    //Icons from react-icons
    <Button variant="primary" icon={<IoAdd />}>
        Hello
    </Button>

Props

| Name | Type | Description | Default | | -------- | -------------------------------------- | ----------------------------------- | ------- | | variant | primary secondary ghost danger | | - | | size | sm md lg | Pass button size as per screen type | md | | children | node | Button text | - | | icon | node | Pass Icon component | - | | align | left right | Icon placement with text | left | | title | string | Icon description for tooltip | - | | disabled | boolean or disabled | Pass boolean or disabled keyword | - |

Configure Theme

You can also configure the theme by extending theme and buttonTheme

//theme.js
// Color Tokens
export const colors = {
  white: "#FFFFFF",
  black: "#000000",
  blue: {
    10: "#ECF2FF",
    20: "#D0E2FF",
    60: "#0F62FE",
    70: "#054ADA",
    80: "#002D9C",
  },
  gray: {
    30: "#C6C6C6",
    50: "#8D8D8D",
    60: "#4C4C4C",
    80: "#393939",
    100: "#161616",
  },
  red: {
    60: "#DA1E28",
    70: "#BA1B23",
    80: "#750E13",
  },
};
// Add different button sizes
export const sizes = {
  lg: {
    h: 48,
    fontSize: 14,
    paddingX: 16,
  },
  md: {
    h: 40,
    fontSize: 12,
    paddingX: 14,
  },
  sm: {
    h: 32,
    fontSize: 10,
    paddingX: 12,
  },
};
//buttonTheme.js
//You can change or add more variants to buttonTheme
import { colors } from "./theme";

export const light = {
  base: colors.white,
  primary: {
    color: colors.white,
    background: colors.blue[60],
    hoverBackground: colors.blue[70],
    activeBackground: colors.blue[80],
    borderColor: colors.blue[60],
  },
  secondary: {
    color: colors.white,
    background: colors.gray[80],
    hoverBackground: colors.gray[60],
    activeBackground: colors.blue[100],
    borderColor: colors.gray[80],
  },
  ghost: {
    color: colors.blue[60],
    background: "transparent",
    hoverBackground: colors.blue[10],
    activeBackground: colors.blue[20],
    borderColor: colors.blue[60],
  },
  danger: {
    color: colors.white,
    background: colors.red[60],
    hoverBackground: colors.red[70],
    activeBackground: colors.red[80],
    borderColor: colors.red[80],
  },
};

export const dark = {
  base: colors.black,
  primary: {
    color: colors.white,
    background: colors.blue[60],
    hoverBackground: colors.blue[70],
    activeBackground: colors.blue[80],
    borderColor: colors.blue[60],
  },
  secondary: {
    color: colors.white,
    background: colors.gray[80],
    hoverBackground: colors.gray[60],
    activeBackground: colors.blue[100],
    borderColor: colors.gray[80],
  },
  ghost: {
    color: colors.blue[60],
    background: "transparent",
    hoverBackground: colors.blue[10],
    activeBackground: colors.blue[20],
    borderColor: colors.blue[60],
  },
  danger: {
    color: colors.white,
    background: colors.red[60],
    hoverBackground: colors.red[70],
    activeBackground: colors.red[80],
    borderColor: colors.red[80],
  },
};