import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogCancel, AlertDialogAction } from "@styple/design-system";
<AlertDialog>
<AlertDialogTrigger asChild>
<Button>Open alertdialog</Button>
</AlertDialogTrigger>
<AlertDialogContent
aria-labelledby="alertdialog-heading"
aria-describedby="alertdialog-desc"
>
<Heading id="alertdialog-heading" as="h4" css={{ mb: "$md" }}>Example Heading</Heading>
<Text id="alertdialog-desc" css={{ lineHeight: "25px" }}>Here is some lorem ipsum example description text.</Text>
<Flex
css={{
justifyContent: "flex-end",
marginTop: "$lg",
gap: "$md",
}}
>
<AlertDialogCancel asChild>
<Button highlight>Cancel</Button>
</AlertDialogCancel>
<AlertDialogAction asChild>
<Button transparent variant="success">Save changes</Button>
</AlertDialogAction>
</Flex>
</AlertDialogContent>
</AlertDialog>
See Radix-UI AlertDialog (v0.1.7) for details. This only covers styple abstractions.
A styled component wrapper for AlertDialog.Root
.
A styled abstraction combining AlertDialog.Overlay
, AlertDialog.Portal
and AlertDialog.Content
.
The rest of the components of the primitive are exported by styple with no changes. Aria-labels can be used as an alternative to AlertDialog.Title
and AlertDialog.Description
as in the example above.