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

@aldiand/reactstrap-confirm

v1.4.7

Published

Promise based confirm for reactstrap

Downloads

40

Readme

Reactstrap confirm

Build Status Codacy Badge npm version

An easy to use promise based confirm dialog for reactstrap.

The objective of this package is to offer a simple and easy way for developers to show confirm dialogs within their apps without having to worry about states or having to repeat the same components in many places.

Demo: https://algm.github.io/reactstrap-confirm

Installation

Simply use npm

npm i --save reactstrap-confirm

You can use yarn as well

yarn add reactstrap-confirm

Dependencies

You must manually install react, react-dom and reactstrap in your project in order for this module to work correctly.

Usage

Simply, import the module and call it as a function anywhere in your code.

import confirm from "reactstrap-confirm";

// ...code

let result = await confirm(); //will display a confirmation dialog with default settings

console.log(result); //if the user confirmed, the result value will be true, false otherwhise

You can also pass options to the confirm function:

confirm({
    title: (
        <>
            Content can have <strong>JSX</strong>!
        </>
    ),
    message: "This is a custom message",
    confirmText: "Custom confirm message",
    confirmColor: "primary",
    cancelColor: "link text-danger"
});

The above example will render a customized dialog.

Available options

| Option | Effect | Default value | | ---------------- | ------------------------------------------------------------------------------------------------------------- | ------------- | | message | Sets the message body of the confirmation dialog | Are you sure? | | title | Sets the title of the dialog window | Warning! | | confirmText | Sets the text of the confirm button | Ok | | cancelText | Sets the text of the cancel button | Cancel | | confirmColor | Sets the color class of the confirm button (see reactstrap docs) | primary | | cancelColor | Sets the color class of the cancel button (see reactstrap docs) | empty | | size | Sets the size property for the modal component (see reactstrap docs) | empty | | buttonsComponent | Can receive a component for rendering the buttons. The component will receive the onClose function as a prop. | empty |