Keep the safe choice first and name the action on the button.
import { Button, Dialog, DialogClose } from '@brand-studio/ui';export default function DialogConfirm() { return ( <Dialog trigger={<Button>Cancel subscription</Button>} title="Cancel your subscription?" description="Your last bag ships on Friday. You can restart any time." > <div className="bs-dialog__actions"> <DialogClose><Button tone="secondary">Keep it</Button></DialogClose> <DialogClose><Button>Cancel subscription</Button></DialogClose> </div> </Dialog> );}
Accessibility
Focus moves into the dialog and stays there until it closes.
Escape, the close button or a click on the backdrop closes it; focus returns to the trigger.
Page scroll is locked while it is open.
Wrap any button in DialogClose to close the dialog when it is pressed.