@codecraftkit
Documentation
The Alert as the name suggests is used to create Alert Dialogs.
This component is based on Alert Dialog
it can be imported from the core.
import { Alert } from "@codecraftkit/core";
or alone.
import Alert from "@codecraftkit/alert";
function MyApp() {const {isOpen, onOpen, onClose} = useDisclosure();return <><Button size='xs' onClick={onOpen}>Open Alert</Button><Alerttitle='Delete Access'body="Are you sure? You can't undo this action afterwards."isOpen={isOpen}onClose={onClose}handleAction={()=>alert("Hello")}// noCancelButton// loading/></>}
title
String
no
The title of the Alert
body
Component
String
no
Component that will be the content of the Alert
isOpen
Boolean
Yes
false
specify if the Alert is open or closed
onClose
Function
yes
Call when the component is closing
handleAction
Function
no
The function that executes the action button when it is click
textActionButton
String
no
Delete
The text that will be shown on the action button
actionButtonColor
String
no
The color of the action button
loading
Boolean
no
false
Loading Animation
noCancelButton
Boolean
no
Remove the cancel button
...rest
chakra style props
no
It receives also every prop of Chakra-ui AlertDialog component