2.0.0-beta.18 • Published 16 days ago

@abw/badger-ui v2.0.0-beta.18

Weekly downloads
-
License
MIT
Repository
github
Last release
16 days ago

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 abw@wardley.org 2018 to 2023

2.0.0-beta.15

16 days ago

2.0.0-beta.14

16 days ago

2.0.0-beta.18

16 days ago

2.0.0-beta.17

16 days ago

2.0.0-beta.16

16 days ago

2.0.0-beta.13

5 months ago

2.0.0-beta.12

5 months ago

2.0.0-beta.11

9 months ago

2.0.0-beta.10

12 months ago

1.1.1-beta.8

1 year ago

1.1.1-beta.9

1 year ago

1.1.1-beta.2

1 year ago

1.1.1-beta.3

1 year ago

1.1.1-beta.0

1 year ago

1.1.1-beta.1

1 year ago

1.1.1-beta.6

1 year ago

1.1.1-beta.7

1 year ago

1.1.1-beta.4

1 year ago

1.1.1-beta.5

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.1.1-beta.16

1 year ago

2.0.0-beta.9

1 year ago

1.1.1-beta.15

1 year ago

2.0.0-beta.8

1 year ago

1.1.1-beta.18

1 year ago

2.0.0-beta.7

1 year ago

1.1.1-beta.17

1 year ago

1.1.1-beta.12

1 year ago

1.1.1-beta.11

1 year ago

1.1.1-beta.14

1 year ago

1.1.1-beta.10

1 year ago

2.0.0-beta.2

1 year ago

2.0.0-beta.1

1 year ago

2.0.0-beta.6

1 year ago

2.0.0-beta.5

1 year ago

1.1.1-beta.19

1 year ago

2.0.0-beta.4

1 year ago

2.0.0-beta.3

1 year ago

1.0.35

1 year ago

1.0.34

2 years ago

1.0.29

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.12

2 years ago

1.0.4

2 years ago