Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

material-ui-confirm

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

material-ui-confirm

Higher order component for straightforward use of @material-ui/core confirmation dialogs.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
47K
decreased by-0.73%
Maintainers
1
Weekly downloads
 
Created
Source

Material-UI confirm GitHub license npm version Build Status Coverage Status

Higher order component for straightforward use of @material-ui/core confirmation dialogs.

Installation

npm install --save material-ui-confirm

Demo

Edit material-ui-confirm demo

Usage

import React from 'react';
import Button from '@material-ui/core/Button';
import withConfirm from 'material-ui-confirm';

const Item = ({ confirm }) => {
  const handleDelete = () => { /* ... */ };

  return (
    <Button onClick={confirm(handleDelete, { description: 'This action is permanent!' })}>
      Click
    </Button>
  );
};

export default withConfirm(Item);

API

withConfirm(Component)

Returns Component adding the confirm function to its props.

confirm(onConfirm, options)

Returns a function that opens the confirmation dialog once called. If the user confirms the action, the onConfirm callback is fired.

Options:
NameTypeDefaultDescription
titlestring'Are you sure?'Dialog title.
descriptionstring''Dialog content.
confirmationTextstring'Ok'Confirmation button caption.
cancellationTextstring'Cancel'Cancellation button caption.
dialogPropsobject{}Material-UI Dialog props.
onClosefunction() => {}Callback fired before the dialog closes.
onCancelfunction() => {}Callback fired when the user cancels the action.

Keywords

FAQs

Package last updated on 17 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc