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

@abw/badger-ui

v2.0.0-beta.18

Published

CSS/React User Interface Components

Downloads

149

Readme

Badger-UI

badger-ui

The badger-ui library contains React components and corresponding styles for rendering various user interface components. It was written by Andy Wardley and evolved over a number of years as he developed web site components for various customers.

You are welcome to use it, but be warned that it is not an officially released UI library and it comes with no warranty, no support and no guarantees that it will be maintained in the future. It was released as a public NPM repository simply to make it easier for him to include it in other projects.

Storybook

See the Storybook for examples of the UI components.

Using the badger-ui Library

Add the badger-ui library to your project.

NOTE: These examples assume you're using pnpm but the equivalent using npm will also work.

cd your-project
pnpm add @abw/badger-ui

Then you can import badger-ui components into your React components.

import { Button } from '@abw/badger-ui'

export const ShowButton = () =>
  <Button text="Hello World" color="red" solid/>

You will also need to import the badger-ui CSS file or build your own custom stylesheet version using SASS.

Importing CSS

To use the default CSS styles import the main CSS file into one of the top-level files for you project:

import '@abw/badger-ui/styles/badger-ui.css'

Customising Styles Using SASS

You can customise the styles using SASS.

Create your own stylesheet and define variables to override the default values (sorry, these aren't documented anywhere yet so you'll need to dig through the files in src/styles/config and src/styles/components to see what they are). Then import the badger-ui styles.

    // custom configuration variables
    $orange: #FF7F00;
    $alert-radius: 10px;
    $checkbox-padding: 2px 4px;

    // import badger-ui styles
    @import "@abw/badger-ui/styles/badger-ui.scss";

You should then import this custom stylesheet into your application.

Custom Icons

The badger-ui library uses a number of icons from the Fontawesome collection.

You will almost certainly want to add further icons to this collection, either incorporating addition Fontawesome icons or custom SVG icons. This is made possible by the svg-icon-librarian module. See the README file in the icons directory for further information.

Updating the badger-ui Library

Follow these steps if you're amending or extending the badger-ui library. These instruction are for the benefit of the author and not intended for end users.

First install all the dependencies.

pnpm install

Build the library using the following command. Output files will be written to the dist directory.

pnpm build

Run the following command to view the Storybook showing examples of the components in action.

pnpm storybook

To check the source code for potential errors, run eslint using this command.

pnpm lint

If you want to delete the dist build directory you can run this command.

pnpm clean

Note that this happens automatically when you run pnpm build.

Author

Andy Wardley [email protected] 2018 to 2023