# material-ui-confirm-button

> A flexible Material UI component to allow confirming of button press

Latest version **0.2.0** (published 2017-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install material-ui-confirm-button
pnpm add material-ui-confirm-button
yarn add material-ui-confirm-button
bun add material-ui-confirm-button
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2017-08-28 |
| First published | 2017-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mark Katerberg |
| Maintainers | katerberg |
| Keywords | react, material, button, confirm, material-ui |

## Links

- npm: https://www.npmjs.com/package/material-ui-confirm-button
- Repository: https://github.com/katerberg/material-ui-confirm-button
- Issues: https://github.com/katerberg/material-ui-confirm-button/issues
- npm.io page: https://npm.io/package/material-ui-confirm-button

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2017-08-28
- 0.1.0 — 2017-08-28
- 0.0.1 — 2017-08-24

## README

# Material UI Confirm Button

![demo](examples/demo.gif)

***

This is a component that allows inline confirmation of a button press. It is
highly customizable and allows most of the options of either FlatButton or
RaisedButton from [Material-UI](http://material-ui.com/).

## Installation

```sh
npm install --save material-ui-confirm-button
```

## Usage

The confirm button visible in the demo above was created as follows:

```js
import ConfirmButton from 'material-ui-confirm-button';
import Delete from 'material-ui/svg-icons/action/delete';

<ConfirmButton icon={<Delete />}
    confirmMessage="Delete"                      
    onSubmit={() => this.props.deleteModel()} />
```

Obviously, you can use this without the ES6 syntax and without material icons.

Note that all properties are forwarded to the button by default, so anything
that is useful on the material buttons can be used here as well.

The only properties that are intercepted are these:

| Property | Type | Description | Required |
| ----- | ---- | ---- | ---- |
| onSubmit | `function` | Callback for confirmed action | `true` |
| onOpen | `function` | Callback for initial button press | `false` |
| onCancel | `function` | Callback for canceling of action | `false` |
| isFlat | `bool` | Whether to use [FlatButton](http://www.material-ui.com/#/components/flat-button). Uses [RaisedButton](http://www.material-ui.com/#/components/raised-button) by default. | `false` |
| label | `string` | Message to display in initial button. | `false` |
| icon | `component` | Icon to display in initial button. This conflicts with `label` | `false` |
| cancelMessage | `string` | Message to display in cancel button. Defaults to "Cancel" | `false` |
| cancelIcon | `component` | Icon to display in cancel button. This conflicts with `cancelMessage` | `false` |
| confirmMessage | `string` | Message to display in confirm button. Defaults to "Confirm" | `false` |
| confirmIcon | `component` | Icon to display in confirm button. This conflicts with `confirmMessage` | `false` |
| isOpen | `bool` | Flag for controlling state. BEWARE: This will become a [Controlled Component](https://fb.me/react-controlled-components). | `false` |



## Small Print

### License

`Material UI Confirm Button` is released under the MIT license.

### Author

Mark Katerberg ([@diablomarcus](http://twitter.com/diablomarcus))

---
_Source: https://npm.io/package/material-ui-confirm-button · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
