@silverstripe/reactstrap-confirm
Confirmation dialogues with reactstrap modals
Last updated 3 months ago by robbieaverill .
BSD-3-Clause · Original npm · Tarball · package.json
$ cnpm install @silverstripe/reactstrap-confirm 
SYNC missed versions from official npm registry.

Reactstrap Confirm

A confirm "polyfill" that creates a reactstrap modal instead of a browser dialog

Requirements

  • React 15+
  • Webpack

Usage

import confirm from '@silverstripe/reactstrap-confirm';
import { Button } from 'reactstrap';

const MyButton = () => {
  const handleClick = async () => {
    if (!await confirm('Are you sure?')) {
      return;
    }
  };

  return <Button onClick={handleClick()}>Click me</Button>;  
}

The confirm function returns a promise that will be resolved with true or false depending on the response of the user. This will render a reactstrap modal into a given DOM node (or document.body by default).

Run yarn storybook for a detailed example.

Current Tags

  • 0.0.5                                ...           latest (3 months ago)

5 Versions

  • 0.0.5                                ...           3 months ago
  • 0.0.4                                ...           6 months ago
  • 0.0.3                                ...           6 months ago
  • 0.0.2                                ...           6 months ago
  • 0.0.1                                ...           6 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 5
Last Month 5
Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |