x
1
2
3
4
5
6
7
8
9
<button id="overlay-show-overlay-158b3ee0-bf1c-4a6c-a30c-066cd79a3197" popovertarget="overlay-158b3ee0-bf1c-4a6c-a30c-066cd79a3197" aria-haspopup="true" type="button" data-view-component="true" class="Button--secondary Button--medium Button"> <span class="Button-content"> <span class="Button-label">Show Overlay Menu</span> </span></button><anchored-position role="menu" id="overlay-158b3ee0-bf1c-4a6c-a30c-066cd79a3197" anchor="overlay-show-overlay-158b3ee0-bf1c-4a6c-a30c-066cd79a3197" align="center" side="outside-bottom" anchor-offset="normal" popover="auto" aria-label="Menu" data-view-component="true"> <div data-view-component="true" class="Overlay Overlay--size-auto"> <div data-view-component="true" class="Overlay-body">This is a menu</div> </div></anchored-position>
1
2
3
4
5
6
7
8
9
10
11
12
render(Primer::Alpha::Overlay.new( title: "Menu", role: :menu, size: size, padding: padding, anchor_align: anchor_align, anchor_side: anchor_side, allow_out_of_bounds: allow_out_of_bounds )) do |d| d.with_show_button { button_text } d.with_body { body_text }end
No notes provided.
app/components/primer/alpha/overlay.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
anchored-position[popover] { border-width: 0; padding: 0; position: absolute; min-width: 192px; overflow: visible;}anchored-position:not(.Overlay) { background: none;}/* stylelint-disable-next-line selector-pseudo-class-no-unknown */.Overlay[popover]:not(:popover-open) { display: none}anchored-position.not-anchored::backdrop, dialog::backdrop { background-color: var(--overlay-backdrop-bgColor, var(--color-neutral-muted));}select-panel dialog::backdrop { background: none;}@media (forced-colors: active) { .Overlay { outline: solid 1px transparent; }}