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 🙏

© 2026 – Pkg Stats / Ryan Hefner

custom-themed-button

v1.0.5

Published

A buttons package that works best with styled-components. so set up your styled-components theme if you haven't already and keep on reading!

Readme

Custom Themed Button

A buttons package that works best with styled-components. so set up your styled-components theme if you haven't already and keep on reading!

Alt Text

CodeSandbox playground: https://codesandbox.io/s/custom-themed-button-sandbox-r6ei7?file=/src/App.tsx

npm i custom-themed-button
// Set up your styled-components theme
export const theme = {
  main: '#39A2DB',
  mainDark: '#053742',
  mainLight: '#A2DBFA',
  sec: '#FFA900',
  secDark: '#E2703A',
  secLight: '#E6DD3B',
  error: '#D44000',
};

// Wrap your app with the <ThemeProvder> and pass your theme
import { ThemeProvider } from 'styled-components';

function App() {
  return <ThemeProvider theme={theme}>...App Children</ThemeProvider>;
}

// The Button Components wil be available anywhere in your app!
import { Button } from 'custom-themed-button';

function Example() {
  return (
    <div>
      <Button text="Custom Themed Button" color="main" bgColor="sec" />
    </div>
  );
}

Note that when we pass color props to the Button component, we use the same names as in the theme object.

Let's review the available props:

Required props:

| prop | value | Description | default | required? | | ------- | ------ | ------------------------------------------------------------------------------------------ | ------- | --------- | | text | string | Button text. | none | no | | color | string | Font color. The name of the color as written in the theme object. e.g color='main' | none | yes | | bgColor | string | Background color. The name of the color as written in the theme object. e.g bgColor='main' | none | yes |

Styling Props:

| prop | value | Description | default | required? | | ------------ | ---------------------------- | ------------------------------------------------------------------------------------------------------ | --------- | --------- | | size | 'xs', 'sm', 'md', 'lg', 'xl' | Background color. The name of the color as written in the theme object. | 'md' | no | | icon | any | Icon to display in the button or next to the text if provided. | none | no | | iconSize | string | The font-size of the icon, any unit is acceptable. e.g: iconSize='2rem' or iconSize='20px'. | 'initial' | no | | iconPosition | 'left', 'right' | The position of the icon, relatively to the text if provided. | 'left' | no | | shape | 'pill', 'circle' | The shape of the button. | regular | no | | showShadow | boolean | Determines whether the button should have a shadow or not. | true | no | | showBorder | boolean | Determines whether the button should have a border or not. | true | no | | borderWidth | string | The width of the border if exists, works with any unit. e.g: borderWidth='2rem' or borderWidth='20px'. | '1px' | no | | borderColor | string | Border color. The name of the color as written in the theme object. e.g borderColor='secDark' | 'bgColor' | no | | fontWeight | string | Font weight of the text. Accepts any valid CSS value. | 'initial' | no |

Animation/Hover Props:

| prop | value | Description | default | required? | | ------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | --------- | | hoverColor | string | Font color on hover. The name of the color as written in the theme object . e.g hoverColor='sec' | color | no | | hoverEffect | 'expand', 'lowerOpacity', '2dClick', 'slideFormLeft', 'slideFromRight' | Button animation on hover | 'expand'. | no | | slideBgColor | string | if a slide hoverEffect was selected, you can specify the background color of the slider. Should be written the same as in the theme object. | inverses 'color'&'bgColor' | no |

Button Element Props:

| prop | value | Description | default | required? | | ----------- | -------- | -------------------------------------------------------- | ------- | --------- | | handleClick | function | Works the same as onClick. | none | no | | disabled | boolean | Determines whether the button should be disabled or not. | false | no |

Hit me up at [email protected] if you have any questions.

Also available on LinkedIn