Modal #

Modal components are used to enable users to display messages or forms without leaving the page.

import { PModal } from 'pearkit';

Basic #

A simple modal component wrapped into an POverlay component.

const [modalStatus,setModalStatus] = useState(false);
    
<PButton onClick={() => setModalStatus(true)}>Open Basic Modal</PButton>
<PModal
    modalTitle="Lorem Ipsum Modal"
    status={modalStatus}
    close={() => setModalStatus(false)}
>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Commodi, sequi.</p>
</PModal>

Accessibility (Not Ready Yet) #

None

Api #

Here you can see all the working features for the modal component.

NameTypeDefaultDescription
modalHeaderReactNodenullOverride header of the component.
statusbooleanfalseStatus state of the component
closablebooleantrueClosable state of the component
modalTitlestringnullModal Title of the component
overlayColorTwColor | Tailwind color names union + 'white' and 'black' name supportblackChange overlay colors of the component
sizestring | small | default | large | fulldefaultSize of the component
closefunctionvoidClose method of the component