Duostrap Dialog
A Duostrap modal dialog with a slide-in transition, 6px rounded corners and a theme-aware footer.
Duostrap Dialog builds on Base Dialog and preserves the 560px panel, 6px corners, 300 ms top -25% -> 10% slide transition and 80% black backdrop. The footer uses the theme’s secondary surface and foreground colors.
Preview
Section titled “Preview”<wc-duostrap-dialog-root a11y-label="Edit profile">
<wc-duostrap-dialog-trigger>
Open Dialog
</wc-duostrap-dialog-trigger>
<wc-duostrap-dialog-mask></wc-duostrap-dialog-mask>
<wc-duostrap-dialog-content>
<wc-duostrap-dialog-header>
<wc-duostrap-dialog-title>
Edit profile
</wc-duostrap-dialog-title>
</wc-duostrap-dialog-header>
<div class="px-[15px] py-[15px]">
<wc-duostrap-dialog-description>
Make changes to your profile here. Click save when you're
done.
</wc-duostrap-dialog-description>
</div>
<wc-duostrap-dialog-footer>
<wc-duostrap-dialog-close>Close</wc-duostrap-dialog-close>
<wc-duostrap-dialog-close>
Save changes
</wc-duostrap-dialog-close>
</wc-duostrap-dialog-footer>
<wc-duostrap-dialog-close-icon></wc-duostrap-dialog-close-icon>
</wc-duostrap-dialog-content>
</wc-duostrap-dialog-root>Installation
Section titled “Installation”Use @proto.ui/prototypes-duostrap/dialog and your host adapter from the same workspace revision. The React example adapts the exported prototypes directly with @proto.ui/adapter-react.
import * as React from 'react';import { createReactAdapter } from '@proto.ui/adapter-react';import * as proto from '@proto.ui/prototypes-duostrap/dialog';
const adapt = createReactAdapter(React);const BootstrapDialogClose = adapt(proto.dialogClose);const BootstrapDialogCloseIcon = adapt(proto.dialogCloseIcon);const BootstrapDialogContent = adapt(proto.dialogContent);const BootstrapDialogDescription = adapt(proto.dialogDescription);const BootstrapDialogFooter = adapt(proto.dialogFooter);const BootstrapDialogHeader = adapt(proto.dialogHeader);const BootstrapDialogMask = adapt(proto.dialogMask);const BootstrapDialogRoot = adapt(proto.dialogRoot);const BootstrapDialogTitle = adapt(proto.dialogTitle);const BootstrapDialogTrigger = adapt(proto.dialogTrigger);
export function BootstrapDialogExample() { return ( <BootstrapDialogRoot a11yLabel="Edit profile"> <BootstrapDialogTrigger>Open Dialog</BootstrapDialogTrigger> <BootstrapDialogMask /> <BootstrapDialogContent> <BootstrapDialogHeader> <BootstrapDialogTitle>Edit profile</BootstrapDialogTitle> </BootstrapDialogHeader> <div className="px-[15px] py-[15px]"> <BootstrapDialogDescription> Make changes to your profile here. Click save when you're done. </BootstrapDialogDescription> </div> <BootstrapDialogFooter> <BootstrapDialogClose>Close</BootstrapDialogClose> </BootstrapDialogFooter> <BootstrapDialogCloseIcon /> </BootstrapDialogContent> </BootstrapDialogRoot> );}Composition
Section titled “Composition”BootstrapDialogRoot├── BootstrapDialogTrigger├── BootstrapDialogMask└── BootstrapDialogContent ├── BootstrapDialogHeader │ └── BootstrapDialogTitle ├── BootstrapDialogDescription ├── BootstrapDialogFooter │ └── BootstrapDialogClose └── BootstrapDialogCloseIconVisual and behavioral details
Section titled “Visual and behavioral details”- Classic motion:
Contentruns Duostrap’s 300 ms opacity and-25% -> 10%top slide presence transition, paired with a 150 ms backdrop fade to 80% black opacity. Mask(z-40) andContent(z-50) own the backdrop and panel stacking.Headerapplies9px 15pxpadding and a hairline divider.Footerseparates its actions from the body with a theme-colored top border.- Accessibility: Full focus trapping, trigger focus restoration,
Escapeand outside-press dismissal, and livearia-labelledby/aria-describedbylinks.
Examples
Section titled “Examples”No Close Button
Section titled “No Close Button”Omit the top-right close icon and dismiss via Escape, backdrop click, or the footer action.
<wc-duostrap-dialog-root a11y-label="No close button">
<wc-duostrap-dialog-trigger>
No Close Button
</wc-duostrap-dialog-trigger>
<wc-duostrap-dialog-mask></wc-duostrap-dialog-mask>
<wc-duostrap-dialog-content>
<wc-duostrap-dialog-header>
<wc-duostrap-dialog-title>
No Close Button
</wc-duostrap-dialog-title>
</wc-duostrap-dialog-header>
<div class="px-[15px] py-[15px]">
<wc-duostrap-dialog-description>
This modal omits the top-right close icon and delegates
dismissal to Escape, backdrop click, or the footer button.
</wc-duostrap-dialog-description>
</div>
<wc-duostrap-dialog-footer>
<wc-duostrap-dialog-close>Close</wc-duostrap-dialog-close>
</wc-duostrap-dialog-footer>
</wc-duostrap-dialog-content>
</wc-duostrap-dialog-root>Scrollable Content
Section titled “Scrollable Content”Scroll long copy inside a 15px padded modal body while keeping the header anchored.
<wc-duostrap-dialog-root a11y-label="Scrollable content">
<wc-duostrap-dialog-trigger>
Scrollable Content
</wc-duostrap-dialog-trigger>
<wc-duostrap-dialog-mask></wc-duostrap-dialog-mask>
<wc-duostrap-dialog-content>
<wc-duostrap-dialog-header>
<wc-duostrap-dialog-title>
Scrollable Content
</wc-duostrap-dialog-title>
</wc-duostrap-dialog-header>
<div class="max-h-[45vh] overflow-y-auto px-[15px] py-[15px]">
<wc-duostrap-dialog-description>
Long body text scrolls cleanly inside the 560px classic
modal frame.
</wc-duostrap-dialog-description>
</div>
<wc-duostrap-dialog-close-icon></wc-duostrap-dialog-close-icon>
</wc-duostrap-dialog-content>
</wc-duostrap-dialog-root>Sticky Footer
Section titled “Sticky Footer”Keep primary and secondary modal footer actions visible below a scrollable checklist.
<wc-duostrap-dialog-root a11y-label="Sticky footer">
<wc-duostrap-dialog-trigger>
Sticky Footer
</wc-duostrap-dialog-trigger>
<wc-duostrap-dialog-mask></wc-duostrap-dialog-mask>
<wc-duostrap-dialog-content>
<wc-duostrap-dialog-header>
<wc-duostrap-dialog-title>
Deployment checklist
</wc-duostrap-dialog-title>
</wc-duostrap-dialog-header>
<div class="max-h-[40vh] overflow-y-auto px-[15px] py-[15px]">
<wc-duostrap-dialog-description>
Review the checklist while the modal footer stays pinned
below.
</wc-duostrap-dialog-description>
</div>
<wc-duostrap-dialog-footer>
<wc-duostrap-dialog-close>Cancel</wc-duostrap-dialog-close>
<wc-duostrap-dialog-close>Confirm</wc-duostrap-dialog-close>
</wc-duostrap-dialog-footer>
<wc-duostrap-dialog-close-icon></wc-duostrap-dialog-close-icon>
</wc-duostrap-dialog-content>
</wc-duostrap-dialog-root>BootstrapDialogRoot
Section titled “BootstrapDialogRoot”| Prop | Type | Default |
|---|---|---|
open | boolean | undefined (controlled) |
defaultOpen | boolean | false |
disabled | boolean | false |
alert | boolean | false |
a11yLabel | string | '' |
Other parts
Section titled “Other parts”| Part / Prop | Type | Default |
|---|---|---|
Trigger.disabled | boolean | false |
Mask.passthrough | boolean | false |
Content.focusEntry | 'auto' 'manual' | 'auto' |
Close / CloseIcon.disabled | boolean | false |