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
<div style="width:100%; height: 400px; display: flex; justify-content: center; align-items: center;"> <div style="position:relative;"> <button id="overlay-show-overlay-d5012c76-87b5-4eb0-8d62-b66b564fa438" popovertarget="overlay-d5012c76-87b5-4eb0-8d62-b66b564fa438" 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</span> </span> </button> <anchored-position placement="anchored" role="dialog" id="overlay-d5012c76-87b5-4eb0-8d62-b66b564fa438" anchor="overlay-show-overlay-d5012c76-87b5-4eb0-8d62-b66b564fa438" align="center" side="outside-bottom" anchor-offset="normal" popover="auto" aria-labelledby="overlay-title-overlay-d5012c76-87b5-4eb0-8d62-b66b564fa438" 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-overlay-d5012c76-87b5-4eb0-8d62-b66b564fa438" class="Overlay-title ">Test Overlay</h1> </div> <div class="Overlay-actionWrap"> <button popovertarget="overlay-d5012c76-87b5-4eb0-8d62-b66b564fa438" popovertargetaction="hide" data-close-dialog-id="overlay-d5012c76-87b5-4eb0-8d62-b66b564fa438" 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"></div> </div> </anchored-position> </div></div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<div style="width:100%; height: 400px; display: flex; justify-content: center; align-items: center;"> <div style="position:relative;"> <%= render(Primer::Alpha::Overlay.new( title: title, subtitle: subtitle, role: role, size: size, placement: placement, anchor_align: anchor_align, anchor_side: anchor_side, allow_out_of_bounds: allow_out_of_bounds, visually_hide_title: visually_hide_title, )) do |d| %> <% d.with_header(title: title, size: header_size) %> <% d.with_show_button { button_text } %> <% d.with_body { body_text } %> <% end %> </div></div>
No notes provided.
Param | Description | Input |
---|---|---|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
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; }}