Examples /
Overlays
Dialogs, drawers, dropdown menus, tooltips, command palettes and toasts. They open with the popover attribute: no script, Escape and outside clicks close them.
Confirm dialog
A centered popover with a dimmed backdrop. The buttons inside close it with popovertargetaction="hide".
<button popovertarget="confirm-delete" class="d-inline-flex aic g-8px h-36px px-14px br-8px b-0 bgc-red9 c-white fs-14px fw-500 font-family-inherit cursor-pointer --hover-bgc-red10"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>Delete project</button>
<div id="confirm-delete" popover class="w(min(420px,calc(100vw_-_32px))) p-24px br-14px b-1px-solid-slateTheme5 bgc-slateTheme1 c-slateTheme12 box-shadow(0_24px_48px_-12px_rgb(0_0_0_/_0.35)) --backdrop[bgc-blackA8,backdrop-filter(blur(2px))] o-0 tf-scale-0.96 transition(opacity_.18s,transform_.18s,display_.18s_allow-discrete,overlay_.18s_allow-discrete) --popover-open[o-1,tf-none] @ss--popover-open[o-0,tf-scale-0.96]">
<div class="d-flex g-16px">
<span class="d-grid place-items-center flex-shrink-0 w-40px h-40px br-999px bgc-redTheme3 c-redTheme11"><svg class="w-20px h-20px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4M12 17h.01"/></svg></span>
<div class="d-grid g-6px">
<h2 class="m-0 fs-17px fw-600">Delete “Website redesign”?</h2>
<p class="m-0 fs-14px lh-1.5 c-slateTheme11">This removes the project, its 24 tasks and all files. You can't undo this.</p>
</div>
</div>
<div class="d-flex jc-flex-end g-8px mt-24px">
<button popovertarget="confirm-delete" popovertargetaction="hide" class="d-inline-flex aic g-8px h-36px px-14px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme12 fs-14px fw-500 font-family-inherit cursor-pointer --hover-bgc-slateTheme3 --focus-visible[outline-2px-solid-accentRATheme1000,outline-offset-2px]">Cancel</button>
<button popovertarget="confirm-delete" popovertargetaction="hide" class="d-inline-flex aic h-36px px-14px br-8px b-0 bgc-red9 c-white fs-14px fw-500 font-family-inherit cursor-pointer --hover-bgc-red10">Delete</button>
</div>
</div>export default function ConfirmDialog() {
return (
<>
<button popoverTarget="confirm-delete" className="d-inline-flex aic g-8px h-36px px-14px br-8px b-0 bgc-red9 c-white fs-14px fw-500 font-family-inherit cursor-pointer --hover-bgc-red10">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
</svg>
Delete project
</button>
<div id="confirm-delete" popover="auto" className="w(min(420px,calc(100vw_-_32px))) p-24px br-14px b-1px-solid-slateTheme5 bgc-slateTheme1 c-slateTheme12 box-shadow(0_24px_48px_-12px_rgb(0_0_0_/_0.35)) --backdrop[bgc-blackA8,backdrop-filter(blur(2px))] o-0 tf-scale-0.96 transition(opacity_.18s,transform_.18s,display_.18s_allow-discrete,overlay_.18s_allow-discrete) --popover-open[o-1,tf-none] @ss--popover-open[o-0,tf-scale-0.96]">
<div className="d-flex g-16px">
<span className="d-grid place-items-center flex-shrink-0 w-40px h-40px br-999px bgc-redTheme3 c-redTheme11">
<svg className="w-20px h-20px" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" />
<path d="M12 9v4M12 17h.01" />
</svg>
</span>
<div className="d-grid g-6px">
<h2 className="m-0 fs-17px fw-600">Delete “Website redesign”?</h2>
<p className="m-0 fs-14px lh-1.5 c-slateTheme11">
This removes the project, its 24 tasks and all files. You can't undo this.
</p>
</div>
</div>
<div className="d-flex jc-flex-end g-8px mt-24px">
<button popoverTarget="confirm-delete" popoverTargetAction="hide" className="d-inline-flex aic g-8px h-36px px-14px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme12 fs-14px fw-500 font-family-inherit cursor-pointer --hover-bgc-slateTheme3 --focus-visible[outline-2px-solid-accentRATheme1000,outline-offset-2px]">Cancel</button>
<button popoverTarget="confirm-delete" popoverTargetAction="hide" className="d-inline-flex aic h-36px px-14px br-8px b-0 bgc-red9 c-white fs-14px fw-500 font-family-inherit cursor-pointer --hover-bgc-red10">Delete</button>
</div>
</div>
</>
);
}Drawer
A side panel that slides in from the right. Same popover, different position and transform.
<button popovertarget="cart-drawer" class="d-inline-flex aic g-8px h-36px px-14px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme12 fs-14px fw-500 font-family-inherit cursor-pointer --hover-bgc-slateTheme3 --focus-visible[outline-2px-solid-accentRATheme1000,outline-offset-2px]"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6"/></svg>Open cart</button>
<aside id="cart-drawer" popover class="m-0 inset(0_0_0_auto) w(min(380px,100vw)) h-100% xh-100% p-0 b-0 border-left-1px-solid-slateTheme5 bgc-slateTheme1 c-slateTheme12 box-shadow(-12px_0_32px_-12px_rgb(0_0_0_/_0.3)) --backdrop-bgc-blackA6 tf-translateX(100%) transition(transform_.25s_ease,display_.25s_allow-discrete,overlay_.25s_allow-discrete) --popover-open-tf-none @ss--popover-open-tf-translateX(100%)">
<div class="d-flex fd-column h-100%">
<header class="d-flex aic jcsb px-20px h-60px border-bottom-1px-solid-slateTheme5">
<h2 class="m-0 fs-16px fw-600">Your cart (2)</h2>
<button popovertarget="cart-drawer" popovertargetaction="hide" aria-label="Close" class="d-grid place-items-center w-32px h-32px br-8px b-0 bgc-transparent c-slateTheme11 cursor-pointer --hover[bgc-slateTheme3,c-slateTheme12]"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg></button>
</header>
<ul class="flex-1 overflow-y-auto m-0 p-20px list-style-none d-grid g-16px align-content-start">
<li class="d-flex g-12px"><span class="w-64px h-64px br-10px bgc-amberTheme4"></span><span class="flex-1 d-grid g-2px align-content-start"><b class="fs-14px fw-500">Ceramic mug</b><span class="fs-13px c-slateTheme11">Sand · 1</span></span><b class="fs-14px fw-500">$24</b></li>
<li class="d-flex g-12px"><span class="w-64px h-64px br-10px bgc-tealTheme4"></span><span class="flex-1 d-grid g-2px align-content-start"><b class="fs-14px fw-500">Linen tote</b><span class="fs-13px c-slateTheme11">Sage · 1</span></span><b class="fs-14px fw-500">$38</b></li>
</ul>
<footer class="d-grid g-12px p-20px border-top-1px-solid-slateTheme5">
<div class="d-flex jcsb fs-15px"><span class="c-slateTheme11">Subtotal</span><b class="fw-600">$62.00</b></div>
<button class="h-42px br-10px b-0 bgc-accentRA1000 c-white fs-15px fw-500 font-family-inherit cursor-pointer --hover-bgc-accentRA1100">Checkout</button>
</footer>
</div>
</aside>export default function Drawer() {
return (
<>
<button popoverTarget="cart-drawer" className="d-inline-flex aic g-8px h-36px px-14px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme12 fs-14px fw-500 font-family-inherit cursor-pointer --hover-bgc-slateTheme3 --focus-visible[outline-2px-solid-accentRATheme1000,outline-offset-2px]">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="9" cy="21" r="1" />
<circle cx="20" cy="21" r="1" />
<path d="M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6" />
</svg>
Open cart
</button>
<aside id="cart-drawer" popover="auto" className="m-0 inset(0_0_0_auto) w(min(380px,100vw)) h-100% xh-100% p-0 b-0 border-left-1px-solid-slateTheme5 bgc-slateTheme1 c-slateTheme12 box-shadow(-12px_0_32px_-12px_rgb(0_0_0_/_0.3)) --backdrop-bgc-blackA6 tf-translateX(100%) transition(transform_.25s_ease,display_.25s_allow-discrete,overlay_.25s_allow-discrete) --popover-open-tf-none @ss--popover-open-tf-translateX(100%)">
<div className="d-flex fd-column h-100%">
<header className="d-flex aic jcsb px-20px h-60px border-bottom-1px-solid-slateTheme5">
<h2 className="m-0 fs-16px fw-600">Your cart (2)</h2>
<button popoverTarget="cart-drawer" popoverTargetAction="hide" aria-label="Close" className="d-grid place-items-center w-32px h-32px br-8px b-0 bgc-transparent c-slateTheme11 cursor-pointer --hover[bgc-slateTheme3,c-slateTheme12]">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M18 6 6 18M6 6l12 12" />
</svg>
</button>
</header>
<ul className="flex-1 overflow-y-auto m-0 p-20px list-style-none d-grid g-16px align-content-start">
<li className="d-flex g-12px">
<span className="w-64px h-64px br-10px bgc-amberTheme4" />
<span className="flex-1 d-grid g-2px align-content-start">
<b className="fs-14px fw-500">Ceramic mug</b>
<span className="fs-13px c-slateTheme11">Sand · 1</span>
</span>
<b className="fs-14px fw-500">$24</b>
</li>
<li className="d-flex g-12px">
<span className="w-64px h-64px br-10px bgc-tealTheme4" />
<span className="flex-1 d-grid g-2px align-content-start">
<b className="fs-14px fw-500">Linen tote</b>
<span className="fs-13px c-slateTheme11">Sage · 1</span>
</span>
<b className="fs-14px fw-500">$38</b>
</li>
</ul>
<footer className="d-grid g-12px p-20px border-top-1px-solid-slateTheme5">
<div className="d-flex jcsb fs-15px">
<span className="c-slateTheme11">Subtotal</span>
<b className="fw-600">$62.00</b>
</div>
<button className="h-42px br-10px b-0 bgc-accentRA1000 c-white fs-15px fw-500 font-family-inherit cursor-pointer --hover-bgc-accentRA1100">Checkout</button>
</footer>
</div>
</aside>
</>
);
}Tooltip
CSS only: the wrapper shows its [role=tooltip] child on hover and on keyboard focus. Hover or tab to the buttons.
<div class="d-flex g-16px pt-28px">
<span class="position-relative d-inline-flex --hover_[role=tooltip][o-1,translate-0--4px] --focus-within_[role=tooltip][o-1,translate-0--4px]">
<button aria-describedby="tip-copy" aria-label="Copy link" class="d-grid place-items-center w-36px h-36px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme11 cursor-pointer --hover-c-slateTheme12"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg></button>
<span role="tooltip" id="tip-copy" class="position-absolute bottom-100% l-50% ml--50px w-100px ta-center px-8px py-4px br-6px bgc-slateTheme12 c-slateTheme1 fs-12px fw-500 white-space-nowrap pointer-events-none o-0 transition(opacity_.12s,translate_.12s)">Copy link</span>
</span>
<span class="position-relative d-inline-flex --hover_[role=tooltip][o-1,translate-0--4px] --focus-within_[role=tooltip][o-1,translate-0--4px]">
<button aria-describedby="tip-share" aria-label="Share" class="d-grid place-items-center w-36px h-36px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme11 cursor-pointer --hover-c-slateTheme12"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m22 2-7 20-4-9-9-4z"/><path d="M22 2 11 13"/></svg></button>
<span role="tooltip" id="tip-share" class="position-absolute bottom-100% l-50% ml--50px w-100px ta-center px-8px py-4px br-6px bgc-slateTheme12 c-slateTheme1 fs-12px fw-500 white-space-nowrap pointer-events-none o-0 transition(opacity_.12s,translate_.12s)">Share</span>
</span>
</div>export default function Tooltip() {
return (
<div className="d-flex g-16px pt-28px">
<span className="position-relative d-inline-flex --hover_[role=tooltip][o-1,translate-0--4px] --focus-within_[role=tooltip][o-1,translate-0--4px]">
<button aria-describedby="tip-copy" aria-label="Copy link" className="d-grid place-items-center w-36px h-36px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme11 cursor-pointer --hover-c-slateTheme12">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<rect x="9" y="9" width="13" height="13" rx="2" />
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
</svg>
</button>
<span role="tooltip" id="tip-copy" className="position-absolute bottom-100% l-50% ml--50px w-100px ta-center px-8px py-4px br-6px bgc-slateTheme12 c-slateTheme1 fs-12px fw-500 white-space-nowrap pointer-events-none o-0 transition(opacity_.12s,translate_.12s)">Copy link</span>
</span>
<span className="position-relative d-inline-flex --hover_[role=tooltip][o-1,translate-0--4px] --focus-within_[role=tooltip][o-1,translate-0--4px]">
<button aria-describedby="tip-share" aria-label="Share" className="d-grid place-items-center w-36px h-36px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme11 cursor-pointer --hover-c-slateTheme12">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="m22 2-7 20-4-9-9-4z" />
<path d="M22 2 11 13" />
</svg>
</button>
<span role="tooltip" id="tip-share" className="position-absolute bottom-100% l-50% ml--50px w-100px ta-center px-8px py-4px br-6px bgc-slateTheme12 c-slateTheme1 fs-12px fw-500 white-space-nowrap pointer-events-none o-0 transition(opacity_.12s,translate_.12s)">Share</span>
</span>
</div>
);
}Command palette
The ⌘K search dialog: an input, grouped results and keyboard hints. Wire the list to your data; the styles are all here.
<button popovertarget="cmdk" class="d-flex aic g-10px w-260px h-38px px-12px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme10 fs-14px font-family-inherit cursor-pointer --hover-bc-slateTheme8"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>Search…<kbd class="ml-auto fs-12px font-family-inherit">⌘K</kbd></button>
<div id="cmdk" popover class="mt-10vh mb-auto w(min(560px,calc(100vw_-_32px))) p-0 br-14px b-1px-solid-slateTheme6 bgc-slateTheme1 c-slateTheme12 overflow-hidden box-shadow(0_24px_48px_-12px_rgb(0_0_0_/_0.4)) --backdrop-bgc-blackA6 o-0 tf-scale-0.96 transition(opacity_.18s,transform_.18s,display_.18s_allow-discrete,overlay_.18s_allow-discrete) --popover-open[o-1,tf-none] @ss--popover-open[o-0,tf-scale-0.96]">
<label class="d-flex aic g-10px h-52px px-16px border-bottom-1px-solid-slateTheme5 c-slateTheme10">
<svg class="w-18px h-18px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>
<input autofocus placeholder="Type a command or search…" aria-label="Search" class="flex-1 h-100% b-0 bgc-transparent c-slateTheme12 fs-15px font-family-inherit outline-none --placeholder-c-slateTheme9">
<kbd class="fs-11px b-1px-solid-slateTheme6 br-4px px-5px font-family-inherit">Esc</kbd>
</label>
<div class="p-8px xh-300px overflow-y-auto __p[m-0,px-10px,pt-8px,pb-4px,fs-12px,fw-500,c-slateTheme10] __a[d-flex,aic,g-10px,h-38px,px-10px,br-8px,fs-14px,c-slateTheme12,td-none] __a--hover-bgc-slateTheme3 __a--focus-visible[bgc-accentRATheme100,outline-none] __a_svg-c-slateTheme10">
<p>Projects</p>
<a href="#"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg>Website redesign</a>
<a href="#"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg>Mobile app</a>
<p>Actions</p>
<a href="#"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>New project<kbd class="ml-auto fs-12px c-slateTheme10 font-family-inherit">N</kbd></a>
<a href="#"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="9" cy="8" r="4"/><path d="M2 21a7 7 0 0 1 14 0M16 3.1a4 4 0 0 1 0 7.8M22 21a7 7 0 0 0-4-6.3"/></svg>Invite people</a>
<a href="#"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6"/></svg>Settings<kbd class="ml-auto fs-12px c-slateTheme10 font-family-inherit">⌘,</kbd></a>
</div>
</div>export default function CommandPalette() {
return (
<>
<button popoverTarget="cmdk" className="d-flex aic g-10px w-260px h-38px px-12px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme10 fs-14px font-family-inherit cursor-pointer --hover-bc-slateTheme8">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="11" cy="11" r="7" />
<path d="m20 20-3.5-3.5" />
</svg>
Search…
<kbd className="ml-auto fs-12px font-family-inherit">⌘K</kbd>
</button>
<div id="cmdk" popover="auto" className="mt-10vh mb-auto w(min(560px,calc(100vw_-_32px))) p-0 br-14px b-1px-solid-slateTheme6 bgc-slateTheme1 c-slateTheme12 overflow-hidden box-shadow(0_24px_48px_-12px_rgb(0_0_0_/_0.4)) --backdrop-bgc-blackA6 o-0 tf-scale-0.96 transition(opacity_.18s,transform_.18s,display_.18s_allow-discrete,overlay_.18s_allow-discrete) --popover-open[o-1,tf-none] @ss--popover-open[o-0,tf-scale-0.96]">
<label className="d-flex aic g-10px h-52px px-16px border-bottom-1px-solid-slateTheme5 c-slateTheme10">
<svg className="w-18px h-18px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="11" cy="11" r="7" />
<path d="m20 20-3.5-3.5" />
</svg>
<input autoFocus placeholder="Type a command or search…" aria-label="Search" className="flex-1 h-100% b-0 bgc-transparent c-slateTheme12 fs-15px font-family-inherit outline-none --placeholder-c-slateTheme9" />
<kbd className="fs-11px b-1px-solid-slateTheme6 br-4px px-5px font-family-inherit">Esc</kbd>
</label>
<div className="p-8px xh-300px overflow-y-auto __p[m-0,px-10px,pt-8px,pb-4px,fs-12px,fw-500,c-slateTheme10] __a[d-flex,aic,g-10px,h-38px,px-10px,br-8px,fs-14px,c-slateTheme12,td-none] __a--hover-bgc-slateTheme3 __a--focus-visible[bgc-accentRATheme100,outline-none] __a_svg-c-slateTheme10">
<p>Projects</p>
<a href="#">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
</svg>
Website redesign
</a>
<a href="#">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
</svg>
Mobile app
</a>
<p>Actions</p>
<a href="#">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M12 5v14M5 12h14" />
</svg>
New project
<kbd className="ml-auto fs-12px c-slateTheme10 font-family-inherit">N</kbd>
</a>
<a href="#">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="9" cy="8" r="4" />
<path d="M2 21a7 7 0 0 1 14 0M16 3.1a4 4 0 0 1 0 7.8M22 21a7 7 0 0 0-4-6.3" />
</svg>
Invite people
</a>
<a href="#">
<svg className="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6" />
</svg>
Settings
<kbd className="ml-auto fs-12px c-slateTheme10 font-family-inherit">⌘,</kbd>
</a>
</div>
</div>
</>
);
}Toasts
Notification toasts with an icon, text, an action and a close button. Here they sit in the preview; in an app, put the stack in a fixed corner.
<ol class="w-100% xw-380px m-0 p-0 list-style-none d-grid g-10px">
<li role="status" class="d-flex g-12px p-14px br-12px b-1px-solid-slateTheme5 bgc-slateTheme1 box-shadow(0_8px_24px_-8px_rgb(0_0_0_/_0.18))">
<span class="c-greenTheme9"><svg class="w-20px h-20px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg></span>
<div class="flex-1 d-grid g-2px"><b class="fs-14px fw-600 c-slateTheme12">Changes saved</b><span class="fs-13px c-slateTheme11">Your profile is up to date.</span></div>
<button aria-label="Dismiss" class="d-grid place-items-center w-24px h-24px br-6px b-0 bgc-transparent c-slateTheme10 cursor-pointer --hover[bgc-slateTheme3,c-slateTheme12]"><svg class="w-14px h-14px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg></button>
</li>
<li role="status" class="d-flex g-12px p-14px br-12px b-1px-solid-slateTheme5 bgc-slateTheme1 box-shadow(0_8px_24px_-8px_rgb(0_0_0_/_0.18))">
<span class="c-slateTheme11"><svg class="w-20px h-20px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg></span>
<div class="flex-1 d-grid g-2px"><b class="fs-14px fw-600 c-slateTheme12">Message deleted</b><span class="fs-13px c-slateTheme11">It's in the bin for 30 days.</span></div>
<button class="h-26px px-10px br-6px b-1px-solid-slateTheme7 bgc-transparent c-slateTheme12 fs-13px font-family-inherit cursor-pointer --hover-bgc-slateTheme3">Undo</button>
</li>
<li role="alert" class="d-flex g-12px p-14px br-12px b-1px-solid-redTheme6 bgc-redTheme2 box-shadow(0_8px_24px_-8px_rgb(0_0_0_/_0.18))">
<span class="c-redTheme11"><svg class="w-20px h-20px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6M9 9l6 6"/></svg></span>
<div class="flex-1 d-grid g-2px"><b class="fs-14px fw-600 c-redTheme12">Upload failed</b><span class="fs-13px c-redTheme11">report.pdf is larger than 10 MB.</span></div>
</li>
</ol>export default function Toasts() {
return (
<ol className="w-100% xw-380px m-0 p-0 list-style-none d-grid g-10px">
<li role="status" className="d-flex g-12px p-14px br-12px b-1px-solid-slateTheme5 bgc-slateTheme1 box-shadow(0_8px_24px_-8px_rgb(0_0_0_/_0.18))">
<span className="c-greenTheme9">
<svg className="w-20px h-20px" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="10" />
<path d="m9 12 2 2 4-4" />
</svg>
</span>
<div className="flex-1 d-grid g-2px">
<b className="fs-14px fw-600 c-slateTheme12">Changes saved</b>
<span className="fs-13px c-slateTheme11">Your profile is up to date.</span>
</div>
<button aria-label="Dismiss" className="d-grid place-items-center w-24px h-24px br-6px b-0 bgc-transparent c-slateTheme10 cursor-pointer --hover[bgc-slateTheme3,c-slateTheme12]">
<svg className="w-14px h-14px" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M18 6 6 18M6 6l12 12" />
</svg>
</button>
</li>
<li role="status" className="d-flex g-12px p-14px br-12px b-1px-solid-slateTheme5 bgc-slateTheme1 box-shadow(0_8px_24px_-8px_rgb(0_0_0_/_0.18))">
<span className="c-slateTheme11">
<svg className="w-20px h-20px" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
</svg>
</span>
<div className="flex-1 d-grid g-2px">
<b className="fs-14px fw-600 c-slateTheme12">Message deleted</b>
<span className="fs-13px c-slateTheme11">It's in the bin for 30 days.</span>
</div>
<button className="h-26px px-10px br-6px b-1px-solid-slateTheme7 bgc-transparent c-slateTheme12 fs-13px font-family-inherit cursor-pointer --hover-bgc-slateTheme3">Undo</button>
</li>
<li role="alert" className="d-flex g-12px p-14px br-12px b-1px-solid-redTheme6 bgc-redTheme2 box-shadow(0_8px_24px_-8px_rgb(0_0_0_/_0.18))">
<span className="c-redTheme11">
<svg className="w-20px h-20px" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="10" />
<path d="m15 9-6 6M9 9l6 6" />
</svg>
</span>
<div className="flex-1 d-grid g-2px">
<b className="fs-14px fw-600 c-redTheme12">Upload failed</b>
<span className="fs-13px c-redTheme11">report.pdf is larger than 10 MB.</span>
</div>
</li>
</ol>
);
}