Skip to main content

Dialog

Import

import { Dialog, DialogTitle, DialogDescription, DialogClose, DialogTrigger, DialogContent, Button, Flex } from "@sparrowengg/twigs-react";

Usage

Result
Loading...
<Dialog>
  <DialogTrigger asChild>
    <Button size="lg">Edit profile</Button>
  </DialogTrigger>
  <DialogContent>
    <DialogTitle>Edit profile</DialogTitle>
    <DialogDescription css={{ color: "$neutral600", fontSize: "$sm" }}>
      Make changes to your profile here. Click save when done.
    </DialogDescription>
    <Flex>
      <DialogClose asChild>
        <Button color="default">Close</Button>
      </DialogClose>
    </Flex>
  </DialogContent>
</Dialog>

Props

Dialog

PropertyDescriptionTypeDefault
defaultOpenuncontrolled open statebooleanfalse
opencontroller open stateboolean
onOpenChangecallback function for state changes
sizesize of the dialogsm md lg xl fullmd
scrollBehaviorcontrol scroll behaviorauto scroll hiddenauto