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

@roann/button

v0.1.0

Published

A reusable Button component for web applications, inspired by Material UI

Downloads

60

Readme

@sb/button

A versatile and accessible Button component for React web applications. Inspired by Material UI, this component provides multiple variants, sizes, and states out of the box.

Installation

npm install @sb/button

# or using yarn
yarn add @sb/button

# or using pnpm
pnpm add @sb/button

Features

  • 🎨 Multiple variants: primary, secondary, ghost, ghostDark, cyan, withShadow
  • 📐 Three size options: small, medium, large
  • ♿ Fully accessible with proper ARIA labels and keyboard support
  • 🚀 Loading state with spinner
  • 🎯 Icon support with automatic sizing
  • 🔧 Customizable via className and style props
  • ✨ TypeScript support with full type definitions

Basic Usage

import { Button } from '@sb/button';

function App() {
  return (
    <Button 
      label="Click Me" 
      onClick={() => console.log('Clicked!')} 
    />
  );
}

Props

ButtonProps

| Prop | Type | Default | Description | |------|------|---------|-------------| | label | string \| ReactNode | required | Button text or content | | onClick | () => void | - | Click handler function | | variant | 'primary' \| 'secondary' \| 'ghost' \| 'ghostDark' \| 'cyan' \| 'withShadow' | 'primary' | Button style variant | | size | 'small' \| 'medium' \| 'large' | 'medium' | Button size | | disabled | boolean | false | Disable the button | | loading | boolean | false | Show loading spinner | | rounded | boolean | true | Add border radius | | icon | ReactNode | - | Icon element to display | | className | string | - | Additional CSS classes | | textStyle | string | - | CSS classes for the label text |

Examples

Variants

<Button label="Primary" variant="primary" />
<Button label="Secondary" variant="secondary" />
<Button label="Ghost" variant="ghost" />
<Button label="Ghost Dark" variant="ghostDark" />
<Button label="Cyan" variant="cyan" />
<Button label="With Shadow" variant="withShadow" />

Sizes

<Button label="Small" size="small" />
<Button label="Medium" size="medium" />
<Button label="Large" size="large" />

With Icon

import { Button } from '@sb/button';

const CheckIcon = (
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
    <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
  </svg>
);

<Button label="Confirm" icon={CheckIcon} />

Loading State

const [isLoading, setIsLoading] = useState(false);

return (
  <Button 
    label="Submit" 
    loading={isLoading}
    onClick={() => setIsLoading(true)}
  />
);

Disabled State

<Button label="Disabled" disabled />

Styling

The component uses CSS variables for theming. Ensure you have the required theme variables available:

  • --color-buttonMainBackgroundColor
  • --color-buttonMainHoverBackground
  • --color-buttonMainDisabledBackgroundColor
  • --color-primary
  • And more theme variables for other variants

Custom Styling

<Button 
  label="Custom" 
  className="my-custom-class"
/>

Accessibility

  • ✅ Semantic HTML with <button> element
  • ✅ Proper ARIA labels
  • ✅ Keyboard navigation support (Enter, Space)
  • ✅ Focus management
  • ✅ Screen reader friendly

Development

Local Development

npm run dev

Running Tests

npm run test
npm run test:watch
npm run test:coverage

Building

npm run build

Linting

npm run lint
npm run check-types

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.