Skip to Content

DialogControls

This component is a utility component designed for the Dialog component.

Title
Dialog content
Expand code
<Button variant={'outlined'} dark={dark} onClick={() => setIsVisible(true)}>Show Dialog</Button> <Dialog size={'small'} open={isVisible} onCancel={() => setIsVisible(false)} dark={dark}> <DialogTitle>Title</DialogTitle> <DialogContent> Dialog content </DialogContent> <DialogControls> <Button variant={'text'} onClick={() => {setIsVisible(false)}}>Confirm</Button> <Button variant={'text'} color={'error'} onClick={() => {setIsVisible(false)}}>Cancel</Button> </DialogControls> </Dialog>

Since dialogContent is a utility component, using it outside the dialog component will just render the content of the component:

<DialogControls> <Button variant={'filled'}>Button</Button> </DialogControls>

Position

The position of the children can be either start, end or space-between.

Title
Children of the dialog-controls will be left-aligned
Title
Children of the dialog-controls will be right-aligned
Title
Children of the dialog-controls will be positioned with space between them
Expand code
<Button variant={'outlined'} dark={dark} onClick={() => setIsVisible(true)}>Show Dialog</Button> <Dialog size={'small'} open={isVisible} onCancel={() => setIsVisible(false)} dark={dark}> <DialogTitle>Title</DialogTitle> <DialogContent> Dialog content </DialogContent> <DialogControls position={'start'}> // one of 'start' | 'end' | 'space-between' <Button variant={'text'} onClick={() => {setIsVisible(false)}}>Confirm</Button> <Button variant={'text'} color={'error'} onClick={() => {setIsVisible(false)}}>Cancel</Button> </DialogControls> </Dialog>

Props

NameTypeDefaultDescription
childrennode-Content of the component
positionstart | end | space-betweenendPosition of the children
Last updated on