Skip to content

Commit 1ef5378

Browse files
committed
add more stories and descriptions
1 parent 6ef5007 commit 1ef5378

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

packages/uui-popover-container/lib/uui-popover-container.mdx

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ It is also a native popover. So everything descriped in the **[Popover documenta
1010

1111
<div
1212
style={{
13-
borderLeft: '10px solid #f3d41b',
13+
borderLeft: '6px solid #f3d41b',
1414
background: '#f3d41b24',
15-
padding: '0px 12px',
15+
padding: '0px 16px',
1616
display: 'flex',
1717
}}>
1818
When used with UUIButton or any element that is not a native button or input,
@@ -21,12 +21,13 @@ It is also a native popover. So everything descriped in the **[Popover documenta
2121
<br />
2222
<div
2323
style={{
24-
borderLeft: '10px solid #e25555',
24+
borderLeft: '6px solid #e25555',
2525
background: '#e2555512',
26-
padding: '0px 12px',
26+
padding: '0px 16px',
2727
display: 'flex',
2828
}}>
29-
This is experimental and will not work in all browsers. See **[Popover
29+
This uses the Popover API which is experimental and will not work in all
30+
browsers. See **[Popover
3031
documentation](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)**
3132
for more information.
3233
</div>
@@ -49,6 +50,15 @@ It is also a native popover. So everything descriped in the **[Popover documenta
4950
</uui-popover-container>
5051
```
5152

53+
## Add margin
54+
55+
```html
56+
<uui-button popovertarget="my-popover">Open Popover</uui-button>
57+
<uui-popover-container id="my-popover" popover margin="10">
58+
My popover content
59+
</uui-popover-container>
60+
```
61+
5262
## Nested popover
5363

5464
```html
@@ -61,3 +71,19 @@ It is also a native popover. So everything descriped in the **[Popover documenta
6171
</uui-popover-container>
6272
</uui-popover-container>
6373
```
74+
75+
## Manual popover
76+
77+
By default, popovers have a feature known as "light dismiss," which causes them to close if you click outside the popover.
78+
However, you have the option to alter this behavior using the `popover` attribute. The `popover` attribute offers two possible values: `auto` and `manual`. ¨
79+
If you omit a value, it will automatically default to `auto`. Essentially, using `popover` is the same as using `popover="auto"`.
80+
81+
When you set the value to `manual`, the "light dismiss" functionality is disabled.
82+
As a result, you will need to manually close the popover either by clicking the button again or by explicitly toggling the popover.
83+
84+
```html
85+
<uui-button popovertarget="my-popover">Open Popover</uui-button>
86+
<uui-popover-container id="my-popover" popover="manual">
87+
My popover content
88+
</uui-popover-container>
89+
```

0 commit comments

Comments
 (0)