Skip to main content

Dialog

A window that is overlaid on primary content.

http://localhost:3000
function Basic() {
  const [isOpen, setIsOpen] = React.useState(false);

  const handleClose = React.useCallback(() => setIsOpen(false), []);
  const handleOpen = React.useCallback(() => setIsOpen(true), []);

  return (
    <>
      <Button onPress={handleOpen}>Open Dialog</Button>
      <Dialog isOpen={isOpen} onClose={handleClose}>
        <DialogHeader>Dialog Title</DialogHeader>
        <DialogContent>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
          ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
          ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
          reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
          sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
          est laborum.
        </DialogContent>
        <DialogFooter>
          <Button variant="secondary" onPress={handleClose}>
            Close
          </Button>
          <Button onPress={handleClose}>Confirm</Button>
        </DialogFooter>
      </Dialog>
    </>
  );
}

Props

Dialog Props


as?The root element to be rendered

DialogContent Props


as?The root element to be rendered

DialogFooter Props


as?The root element to be rendered

DialogHeader Props


as?The root element to be rendered