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

react-bs-notifier-less

v4.4.0

Published

A react component to show growl-like notifications using bootstrap alerts

Downloads

5

Readme

React Bootstrap Notifier

A react component to show growl-like notifications using bootstrap alerts.

See a live demo.

Usage

npm install react-bs-notifier --save

To show a list of different types of alerts in the top right corner of the page:

import React from "react";
import ReactDOM from "react-dom";
import { AlertList } from "react-bs-notifier";

const alerts = [{
	id: 1,
	type: "info",
	message: "Hello, world"
}, {
	id: 2,
	type: "success",
	message: "Oh, hai"
}]

ReactDOM.render((
	<AlertList alerts={alerts} />
), document.getElementById("myApp"));

Or to show a single inline-alert:

import React from "react";
import ReactDOM from "react-dom";
import { Alert } from "react-bs-notifier";

ReactDOM.render((
	<Alert type="danger" headline="Error!">
		Holy cow, man!
	</Alert>
), document.getElementById("myApp"));

Or show alerts without creating an array (equivalent to first example):

import React from "react";
import ReactDOM from "react-dom";
import { Alert, AlertContainer } from "react-bs-notifier";

ReactDOM.render((
	<AlertContainer>
		<Alert type="info">Hello, world</Alert>
		<Alert type="success">Oh, hai</Alert>
	</AlertContainer>
), document.getElementById("myApp"));

Read the documentation for more in-depth, interactive examples and live demos.

Contributing

PRs Welcome

If you have a new feature or change you'd like to submit, please submit an issue first to talk about the change you want to make. When you are finished making your change, please make sure to also update the documentation. Once you clone this repo, you can run the docs & example app locally:

npm install
npm start

This will spin up a webpack dev server on port 1341. Open your browser to localhost:1341 and any changes you make will build & refresh the page automatically.

Linting

To run the linter:

npm run lint

This project uses prettier for formatting and will fail linting if the code doesn't conform to prettier's output. To automatically fix any formatting issues, run:

npm run lint -- --fix

Or, if you are using an editor that supports ESLint, just make sure to enable automatically fixing lint errors on save. E.g., in Visual Studio Code with the ESLint plugin, make sure this is in your settings.json:

{
  "eslint.autoFixOnSave": true
}

Deploying Docs to Github Pages

This is mostly a note for me so I don't forget. Run npm run build --production and commit the resulting docs/index.html & docs/build.js.* files to the gh-pages branch.