npm package: @paprika/confirmation
Description: Confirmation component allows user to confirm or cancel action
Author: @paprika
Latest version: 4.0.4

<!-- start: Autogenerated - do not modify -->

# @paprika/confirmation

## Description

Confirmation component allows user to confirm or cancel action

## Installation

```
yarn add @paprika/confirmation
```

or with npm:

```
npm install @paprika/confirmation
```

## Props

### Confirmation

| Prop              | Type                                                                                            | required | default                             | Description                                                                  |
| ----------------- | ----------------------------------------------------------------------------------------------- | -------- | ----------------------------------- | ---------------------------------------------------------------------------- |
| body              | node                                                                                            | false    | null                                | Content of the popover confirmation                                          |
| buttonSize        | [ Confirmation.types.size.SMALL, Confirmation.types.size.MEDIUM, Confirmation.types.size.LARGE] | false    | Confirmation.types.size.MEDIUM      | Size of the button                                                           |
| children          | node                                                                                            | false    | null                                |                                                                              |
| confirmButtonType | [ Confirmation.types.kind.PRIMARY, Confirmation.types.kind.DESTRUCTIVE]                         | false    | Confirmation.types.kind.DESTRUCTIVE | Determine the styling of the confirm button                                  |
| confirmLabel      | string                                                                                          | true     | -                                   | Label for the confirm button                                                 |
| customCancelLabel | string                                                                                          | false    | null                                | Custom label for the cancel button                                           |
| defaultIsOpen     | bool                                                                                            | false    | false                               | If the popover is open by default                                            |
| heading           | string                                                                                          | false    | null                                | Heading for the popover confirmation                                         |
| isPending         | bool                                                                                            | false    | false                               | If the confirm button should render in a pending state (with a spinner icon) |
| onClose           | func                                                                                            | false    | () => {}                            | Callback when cancel button is clicked                                       |
| onConfirm         | func                                                                                            | true     | -                                   | Callback when confirm button is clicked                                      |

<!-- end: Autogenerated - do not modify -->
<!-- content -->

## Usage

```js
import Confirmation from "@paprika/confirmation";

<Confirmation
  confirmLabel="Delete filter"
  body="Lorem ipsum dolor amet vexillologist tacos selvage narwhal butcher twee ethical hot chicken"
  onConfirm={handleCloseConfirm => handleConfirm(handleCloseConfirm)}
  onClose={handleClose}
  heading="Delete filter?">
    <Confirmation.TriggerButton>Trigger</Confirmation.TriggerButton>
  </Confirmation>
;

or

<Confirmation
  confirmLabel="Delete filter"
  body="Lorem ipsum dolor amet vexillologist tacos selvage narwhal butcher twee ethical hot chicken"
  defaultIsOpen
  onConfirm={handleCloseConfirm => handleConfirm(handleCloseConfirm)}
  heading="Delete filter?"
/>;
```

## Components

You can use the following components to compose the Confirmation:

<Confirmation.TriggerButton>

<!-- eoContent -->

## Links

- [Storybook Showcase](https://paprika.highbond.com/?path=/story/messaging-confirmation--showcase)
- [GitHub source code](https://github.com/acl-services/paprika/tree/master/packages/Confirmation/src)
- [Create GitHub issue](https://github.com/acl-services/paprika/issues/new?label=[]&title=@paprika/confirmation%20[help]:%20your%20short%20description&body=%0A%23%20Help%20wanted%0A%0A%23%23%20Please%20write%20your%20question.%0A*A%20clear%20and%20concise%20description%20of%20what%20the%20question%20is*%0A%0A%23%23%20Additional%20context%0A*Add%20any%20other%20context%20or%20screenshots%20about%20your%20question%20here.*%0A)
- [CHANGELOG](https://github.com/acl-services/paprika/tree/master/packages/Confirmation/CHANGELOG.md)