cf-component-modal
Cloudflare Modal Component
Installation
Installation with yarn is recommended
$ yarn add cf-component-modal
Usage
import React from 'react';import Modal ModalHeader ModalTitle ModalClose ModalBody ModalFooter ModalActions ModalInfo from 'cf-component-modal';import Button from 'cf-component-button';import Box from 'cf-component-box'; Component { ; thisstate = isModalOpen: false width: null showInfo: false ; thishandleRequestOpen = thishandleRequestOpen; thishandleRequestClose = thishandleRequestClose; } { this; } { this; } { this; } { this; } { return <div> <Button ="default" => Open Modal </Button> <Modal = = = > <ModalHeader> <ModalTitle>Hello from Modal</ModalTitle> <ModalClose = /> </ModalHeader> thisstateshowInfo && <ModalInfo>This is some modal Info</ModalInfo> <ModalBody> <p>Look at this awesome modal!</p> </ModalBody> <ModalFooter> <ModalActions> <Box ="10px" ="inline-block"> <Button ="default" = > Toggle width </Button> </Box> <Box ="10px" ="inline-block"> <Button ="default" = > Toggle info </Button> </Box> <Button ="default" = > Close Modal </Button> </ModalActions> </ModalFooter> </Modal> </div> ; } ;