Socket
Book a DemoInstallSign in
Socket

@forter/confirm

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forter/confirm

confirm from Forter Components

latest
Source
npmnpm
Version
1.3.0
Version published
Weekly downloads
12
300%
Maintainers
3
Weekly downloads
 
Created
Source

fc-confirm

An element by Forter

Usage

<script>
   import '@forter/confirm';
</script>

<fc-confirm opened>
  Are you sure you want to continue?
</fc-confirm>

Examples

<!-- confirm-button-text -->

<fc-confirm opened title="example" confirm-button-text="Foo">confirm text is changed!</fc-confirm>

<!-- cancel-button-text -->

<fc-confirm opened title="example" cancel-button-text="Foo">cancel text is changed</fc-confirm>

<!-- hide-confirm-button -->

<fc-confirm opened title="example" hide-confirm-button>confirm text is changed!</fc-confirm>

<!-- hide-cancel-button -->

<fc-confirm opened title="example" hide-cancel-button>confirm text is changed!</fc-confirm>

<!-- confirm -->

<p> Open: </p>
<fc-button
  onclick="
  FC.confirm({
    title: 'Example',
    content: 'Are you a Forker?',
    confirmButtonText: 'Yes',
    cancelButtonText: 'No'
  })
.then((confirmed)=> confirmed ?
    FC.toast.success({ message: 'You answered yes!'}) :
    FC.toast.danger({ message: 'You answered no!'})
)"
>
Click me!
</fc-button>
<fc-confirm></fc-confirm>

Properties

PropertyAttributeTypeDefaultDescription
cancelButtonTextcancel-button-textstring"Cancel"the text displayed inside the cancel modal
confirmButtonTextconfirm-button-textstring"Confirm"the text displayed inside the confirm button
heightheightstringnullOptional height for the modal
hideCancelButtonhide-cancel-buttonstringfalseHides the cancel button if ture
hideConfirmButtonhide-confirm-buttonstringfalseHides the confirm button if ture
openedopenedbooleanfalsewhether the confirm is open
titletitlestringnullthe text displayed inside the confirm button

Events

EventDescription
on-cancelwhen the cancel/close button was clicked
on-confirmwhen the confirm button was clicked
on-openedwhen opening a confirm you get this event

CSS Custom Properties

PropertyDescription
--fc-confirm-heightheight
--fc-confirm-widthwidth

Keywords

web-components

FAQs

Package last updated on 29 Jun 2023

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