x
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
32
33
34
35
36
37
38
39
40
41
42
<action-menu data-select-variant="none" data-view-component="true"> <focus-group direction="vertical" mnemonics retain> <button id="action-menu-0bf62e8d-152f-4afc-9054-337b4203ef4a-button" popovertarget="action-menu-0bf62e8d-152f-4afc-9054-337b4203ef4a-overlay" aria-controls="action-menu-0bf62e8d-152f-4afc-9054-337b4203ef4a-list" aria-haspopup="true" type="button" data-view-component="true" class="Button--secondary Button--medium Button"> <span class="Button-content"> <span class="Button-label">Menu</span> </span> </button> <anchored-position id="action-menu-0bf62e8d-152f-4afc-9054-337b4203ef4a-overlay" anchor="action-menu-0bf62e8d-152f-4afc-9054-337b4203ef4a-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true"> <div data-view-component="true" class="Overlay Overlay--size-auto"> <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone"> <action-list> <div data-view-component="true"> <ul aria-labelledby="action-menu-0bf62e8d-152f-4afc-9054-337b4203ef4a-button" id="action-menu-0bf62e8d-152f-4afc-9054-337b4203ef4a-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap"> <li data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <button id="item-347a54a0-2909-48bd-bf40-54af035acd12" popovertarget="my-overlay" tabindex="-1" type="button" role="menuitem" data-view-component="true" class="ActionListContent"> <span data-view-component="true" class="ActionListItem-label"> Open Overlay </span> </button> </li> </ul> </div> </action-list> </div> </div> </anchored-position> </focus-group></action-menu><anchored-position role="dialog" id="my-overlay" anchor="overlay-show-my-overlay" align="start" side="outside-bottom" anchor-offset="normal" popover="manual" aria-labelledby="overlay-title-my-overlay" data-view-component="true"> <div data-view-component="true" class="Overlay Overlay--size-auto"> <header data-view-component="true" class="Overlay-header"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 id="overlay-title-my-overlay" class="Overlay-title ">An overlay</h1> </div> <div class="Overlay-actionWrap"> <button popovertarget="my-overlay" popovertargetaction="hide" data-close-dialog-id="my-overlay" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </header> <div data-view-component="true" class="Overlay-body">This is an overlay</div> </div></anchored-position>
1
2
3
4
5
6
7
8
9
10
11
12
13
<%= render(Primer::Alpha::ActionMenu.new()) do |menu| %> <% menu.with_show_button { "Menu" } %> <% menu.with_item(label: "Open Overlay", content_arguments: { id: "overlay-show-my-overlay", popovertarget: "my-overlay" }) %><% end %><%= render(Primer::Alpha::Overlay.new( id: "my-overlay", title: "An overlay", role: :dialog, popover: "manual",)) do |d| %> <% d.with_header(title: "An overlay") %> <% d.with_body { "This is an overlay" } %><% end %>
No notes provided.
No params configured.
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
/* stylelint-disable selector-max-type, selector-no-qualifying-type */anchored-position[popover] { position: absolute; min-width: 192px; padding: 0; overflow: visible; border-width: 0;}anchored-position:not(.Overlay) { background: none;}.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; }}