You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/primer-popover/README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,36 @@ title: Popover
40
40
status: Experimental
41
41
-->
42
42
43
+
Popovers are used to bring attention to specific user interface elements, typically to suggest an action or to guide users through a new experience. They consist of:
44
+
45
+
- The block element, `.Popover`, which simply positions its content absolutely atop other body content.
46
+
- The child element, `.Popover-message`, which contains the markup for the intended messaging and the visual "caret."
47
+
48
+
In the examples below, `Popover-message`, in particular, uses a handful of utility classes to style it appropriately. And these are intended to demonstrate the default, go-to presentation for the popover's message. By default, the message's caret is centered on the top edge of the message.
49
+
50
+
The `Popover-message` element also supports several modifiers, most of which position the caret differently:
51
+
52
+
-`.Popover-message--top` (default): Places the caret on the top edge of the message, horizontally centered.
53
+
-`.Popover-message--bottom`: Places the caret on the bottom edge of the message, horizontally centered.
54
+
-`.Popover-message--right`: Places the caret on the right edge of the message, vertically centered.
55
+
-`.Popover-message--left`: Places the caret on the left edge of the message, vertically centered.
56
+
57
+
Each of these modifiers also support a syntax for adjusting the positioning the caret to the right, left, top, or bottom of its respective edge. That syntax looks like:
58
+
59
+
-`.Popover-message--top--right`
60
+
-`.Popover-message--right--top`
61
+
-`.Popover-message--bottom--left`
62
+
-`.Popover-message--left--bottom`
63
+
64
+
Lastly, there is an added `.Popover-message--lg` modifer, which Assumes a slightly wider popover message.
65
+
66
+
### Notes
67
+
68
+
The samples below include optional markup, like:
69
+
- An outermost container that establishes stacking context (e.g. `position-relative`).
70
+
- A choice piece of user interface (a button, in this case) to relate the popover to.
71
+
- Use of the `Details` and `js-details` family of class names, which interact with JavaScript to demonstrate dismissal of the popover by clicking the nested "Got it!" button.
0 commit comments