@iress-oss/ids-mcp-server 6.0.0-alpha.1-canary-20251204032753-fe18cab → 6.0.0-alpha.1-canary-20251204040305-3639454
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generated/docs/components_components-alert-docs.md +1054 -0
- package/generated/docs/components_components-autocomplete-docs.md +3304 -0
- package/generated/docs/components_components-autocomplete-recipes-docs.md +98 -0
- package/generated/docs/components_components-badge-docs.md +312 -0
- package/generated/docs/components_components-button-docs.md +2339 -0
- package/generated/docs/components_components-buttongroup-docs.md +980 -0
- package/generated/docs/components_components-card-docs.md +1970 -0
- package/generated/docs/components_components-checkbox-docs.md +1083 -0
- package/generated/docs/components_components-checkboxgroup-docs.md +1597 -0
- package/generated/docs/components_components-checkboxgroup-recipes-docs.md +209 -0
- package/generated/docs/components_components-col-docs.md +755 -0
- package/generated/docs/components_components-container-docs.md +172 -0
- package/generated/docs/components_components-divider-docs.md +235 -0
- package/generated/docs/components_components-expander-docs.md +428 -0
- package/generated/docs/components_components-field-docs.md +3345 -0
- package/generated/docs/components_components-filter-docs.md +4091 -0
- package/generated/docs/components_components-hide-docs.md +450 -0
- package/generated/docs/components_components-icon-docs.md +1017 -0
- package/generated/docs/components_components-image-docs.md +168 -0
- package/generated/docs/components_components-inline-docs.md +1962 -0
- package/generated/docs/components_components-input-docs.md +1388 -0
- package/generated/docs/components_components-input-recipes-docs.md +349 -0
- package/generated/docs/components_components-inputcurrency-docs.md +636 -0
- package/generated/docs/components_components-inputcurrency-recipes-docs.md +208 -0
- package/generated/docs/components_components-introduction-docs.md +448 -0
- package/generated/docs/components_components-label-docs.md +229 -0
- package/generated/docs/components_components-link-docs.md +454 -0
- package/generated/docs/components_components-menu-docs.md +2219 -0
- package/generated/docs/components_components-menu-menuitem-docs.md +1455 -0
- package/generated/docs/components_components-modal-docs.md +2002 -0
- package/generated/docs/components_components-panel-docs.md +342 -0
- package/generated/docs/components_components-placeholder-docs.md +98 -0
- package/generated/docs/components_components-popover-docs.md +1631 -0
- package/generated/docs/components_components-popover-recipes-docs.md +537 -0
- package/generated/docs/components_components-progress-docs.md +128 -0
- package/generated/docs/components_components-provider-docs.md +123 -0
- package/generated/docs/components_components-radio-docs.md +499 -0
- package/generated/docs/components_components-radiogroup-docs.md +1573 -0
- package/generated/docs/components_components-readonly-docs.md +277 -0
- package/generated/docs/components_components-richselect-docs.md +6101 -0
- package/generated/docs/components_components-row-docs.md +2172 -0
- package/generated/docs/components_components-select-docs.md +1110 -0
- package/generated/docs/components_components-skeleton-docs.md +467 -0
- package/generated/docs/components_components-skeleton-recipes-docs.md +110 -0
- package/generated/docs/components_components-skiplink-docs.md +220 -0
- package/generated/docs/components_components-slideout-docs.md +1910 -0
- package/generated/docs/components_components-slider-docs.md +1284 -0
- package/generated/docs/components_components-spinner-docs.md +90 -0
- package/generated/docs/components_components-stack-docs.md +730 -0
- package/generated/docs/components_components-table-docs.md +4038 -0
- package/generated/docs/components_components-tabset-docs.md +955 -0
- package/generated/docs/components_components-tabset-tab-docs.md +342 -0
- package/generated/docs/components_components-tag-docs.md +410 -0
- package/generated/docs/components_components-text-docs.md +593 -0
- package/generated/docs/components_components-toaster-docs.md +451 -0
- package/generated/docs/components_components-toggle-docs.md +513 -0
- package/generated/docs/components_components-tooltip-docs.md +564 -0
- package/generated/docs/components_components-validationmessage-docs.md +608 -0
- package/generated/docs/components_contact-us-docs.md +9 -0
- package/generated/docs/components_foundations-accessibility-docs.md +33 -0
- package/generated/docs/components_foundations-consistency-docs.md +44 -0
- package/generated/docs/components_foundations-content-docs.md +18 -0
- package/generated/docs/components_foundations-introduction-docs.md +17 -0
- package/generated/docs/components_foundations-principles-docs.md +60 -0
- package/generated/docs/components_foundations-responsive-layout-docs.md +2692 -0
- package/generated/docs/components_foundations-user-experience-docs.md +53 -0
- package/generated/docs/components_foundations-visual-design-docs.md +39 -0
- package/generated/docs/components_foundations-z-index-stacking-docs.md +288 -0
- package/generated/docs/components_frequently-asked-questions-docs.md +44 -0
- package/generated/docs/components_get-started-develop-docs.md +47 -0
- package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
- package/generated/docs/components_introduction-docs.md +85 -0
- package/generated/docs/components_patterns-form-docs.md +2469 -0
- package/generated/docs/components_patterns-form-recipes-docs.md +1597 -0
- package/generated/docs/components_patterns-introduction-docs.md +31 -0
- package/generated/docs/components_patterns-loading-docs.md +1908 -0
- package/generated/docs/components_patterns-shadow-docs.md +195 -0
- package/generated/docs/components_resources-code-katas-docs.md +25 -0
- package/generated/docs/components_resources-introduction-docs.md +28 -0
- package/generated/docs/components_resources-mcp-server-docs.md +23 -0
- package/generated/docs/components_resources-migration-guides-from-v4-to-v5-docs.md +142 -0
- package/generated/docs/components_styling-props-colour-docs.md +91 -0
- package/generated/docs/components_styling-props-elevation-docs.md +69 -0
- package/generated/docs/components_styling-props-radius-docs.md +63 -0
- package/generated/docs/components_styling-props-reference-docs.md +160 -0
- package/generated/docs/components_styling-props-screen-readers-docs.md +66 -0
- package/generated/docs/components_styling-props-sizing-docs.md +217 -0
- package/generated/docs/components_styling-props-spacing-docs.md +545 -0
- package/generated/docs/components_styling-props-typography-docs.md +66 -0
- package/generated/docs/components_versions-docs.md +14 -0
- package/generated/docs/guidelines.md +3083 -0
- package/generated/docs/introduction-docs.md +37 -0
- package/generated/docs/tokens_colour-docs.md +479 -0
- package/generated/docs/tokens_elevation-docs.md +39 -0
- package/generated/docs/tokens_introduction-docs.md +150 -0
- package/generated/docs/tokens_radius-docs.md +67 -0
- package/generated/docs/tokens_spacing-docs.md +87 -0
- package/generated/docs/tokens_typography-docs.md +305 -0
- package/package.json +2 -2
|
@@ -0,0 +1,1631 @@
|
|
|
1
|
+
Popover
|
|
2
|
+
=======
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
A popover is panel that is toggled on/off by an activator button or text input. The panel is positioned relative to its activator element.
|
|
8
|
+
|
|
9
|
+
[](./iframe.html?id=components-popover--activator)
|
|
10
|
+
|
|
11
|
+
Toggle popover
|
|
12
|
+
|
|
13
|
+
A little more information about this area.
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
<IressPopover activator\={<IressButton\>Toggle popover</IressButton\>}\>
|
|
18
|
+
<IressPanel\>
|
|
19
|
+
A little more information about this area. </IressPanel\>
|
|
20
|
+
</IressPopover\>
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Props
|
|
25
|
+
-----
|
|
26
|
+
|
|
27
|
+
| Name | Description | Default | Control |
|
|
28
|
+
| --- | --- | --- | --- |
|
|
29
|
+
| activator\* |
|
|
30
|
+
Content for an activator element, usually an `IressButton`.
|
|
31
|
+
|
|
32
|
+
PopoverActivatorProps\['children'\]
|
|
33
|
+
|
|
34
|
+
| \- | \- |
|
|
35
|
+
| align |
|
|
36
|
+
|
|
37
|
+
Sets the alignment of the popover relative to the activator element.
|
|
38
|
+
|
|
39
|
+
FloatingUIAligns
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
|
44
|
+
|
|
45
|
+
'auto'
|
|
46
|
+
|
|
47
|
+
| Set object |
|
|
48
|
+
| children |
|
|
49
|
+
|
|
50
|
+
The content to render within the popover.
|
|
51
|
+
|
|
52
|
+
ReactNode
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
| \- | Choose option...nonehellobasicdetailsparagraphmenu |
|
|
57
|
+
| container |
|
|
58
|
+
|
|
59
|
+
The container element to render the popover into. By default, the popover will render where its parent is rendered.
|
|
60
|
+
|
|
61
|
+
**Note:** If the `container` doesn’t exist when the popover is mounted, ensure you pass an element directly (not a ref) and specify null as the default value before it is set. This lets it wait for the root to be available. For example, if you reference the parent element of a popover.
|
|
62
|
+
|
|
63
|
+
FloatingUIContainer
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
| \- | Set object |
|
|
68
|
+
| contentClassName |
|
|
69
|
+
|
|
70
|
+
Class name of the popover content.
|
|
71
|
+
|
|
72
|
+
string
|
|
73
|
+
|
|
74
|
+
<table class="css-3nr4py"><tbody><tr><td colspan="2"><strong>Deprecated</strong>: Use `contentStyle` instead.</td></tr></tbody></table>
|
|
75
|
+
|
|
76
|
+
| \- | Set string |
|
|
77
|
+
| contentStyle |
|
|
78
|
+
|
|
79
|
+
This allows you to customise the content styling specifically, which is the floating element. It accepts an object with any of the styling properties available on `IressCSSProps`, as well as `className` and `style`.
|
|
80
|
+
|
|
81
|
+
IressCustomiseSlot
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
| \- | Set object |
|
|
86
|
+
| defaultShow |
|
|
87
|
+
|
|
88
|
+
When set to `true` the popover will be visible by default. Use for uncontrolled popovers.
|
|
89
|
+
|
|
90
|
+
boolean
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
| \- | Set boolean |
|
|
95
|
+
| displayMode |
|
|
96
|
+
|
|
97
|
+
Sets the display mode of popover.
|
|
98
|
+
|
|
99
|
+
DisplayModes
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
|
104
|
+
|
|
105
|
+
'overlay'
|
|
106
|
+
|
|
107
|
+
| Set object |
|
|
108
|
+
| fluid |
|
|
109
|
+
|
|
110
|
+
Popovers can be fluid, meaning they will take up the full width of their container.
|
|
111
|
+
|
|
112
|
+
boolean
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
| \- | Set boolean |
|
|
117
|
+
| focusStartIndex |
|
|
118
|
+
|
|
119
|
+
Which index to start the focus on when the popover is opened. Only works with `type` listbox and menu. Note: The index must exist in the list of items, otherwise it will not work.
|
|
120
|
+
|
|
121
|
+
number
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
| \- | Set number |
|
|
126
|
+
| matchActivatorWidth |
|
|
127
|
+
|
|
128
|
+
Sets the popover to match the width of the activator. Note: This only works when `displayMode="overlay"`.
|
|
129
|
+
|
|
130
|
+
boolean
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
| \- | Set boolean |
|
|
135
|
+
| onActivated |
|
|
136
|
+
|
|
137
|
+
Is called when popover is activated.
|
|
138
|
+
|
|
139
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
140
|
+
|
|
141
|
+
| \- | \- |
|
|
142
|
+
| onDeactivated |
|
|
143
|
+
|
|
144
|
+
Is called when popover is deactivated.
|
|
145
|
+
|
|
146
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
147
|
+
|
|
148
|
+
| \- | \- |
|
|
149
|
+
| onNavigate |
|
|
150
|
+
|
|
151
|
+
Is called when registered popover items are navigated using arrow keys. Only works with `type` listbox and menu.
|
|
152
|
+
|
|
153
|
+
(activeIndex: number | null) => void
|
|
154
|
+
|
|
155
|
+
| \- | \- |
|
|
156
|
+
| show |
|
|
157
|
+
|
|
158
|
+
When set to `true` the modal will be visible. Use for controlled popovers.
|
|
159
|
+
|
|
160
|
+
boolean
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
| \- | Set boolean |
|
|
165
|
+
| type |
|
|
166
|
+
|
|
167
|
+
Describes the type of content contained in the popover.
|
|
168
|
+
|
|
169
|
+
PopoverHookReturn\['type'\]
|
|
170
|
+
|
|
171
|
+
| \- | Set object |
|
|
172
|
+
| virtualFocus |
|
|
173
|
+
|
|
174
|
+
Whether the focus is virtual (using `aria-activedescendant`). Use this if you need focus to remain on the reference element (such as an input), but allow arrow keys to navigate items. Note: This is only applicable when type is set to: `listbox` or `menu`, and only works out of the box with `IressMenu` and its subcomponents.
|
|
175
|
+
|
|
176
|
+
boolean
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
| \- | Set boolean |
|
|
181
|
+
|
|
182
|
+
Usage
|
|
183
|
+
-----
|
|
184
|
+
|
|
185
|
+
### Activator
|
|
186
|
+
|
|
187
|
+
For the popover to render, the `activator` property is required. It is the element used to trigger the popover, and works best with an `IressButton`.
|
|
188
|
+
|
|
189
|
+
Anything added as the children of the `IressPopover` component will be displayed in the popover panel.
|
|
190
|
+
|
|
191
|
+
[](./iframe.html?id=components-popover--activator)
|
|
192
|
+
|
|
193
|
+
Toggle popover
|
|
194
|
+
|
|
195
|
+
A little more information about this area.
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
<IressPopover activator\={<IressButton\>Toggle popover</IressButton\>}\>
|
|
200
|
+
<IressPanel\>
|
|
201
|
+
A little more information about this area. </IressPanel\>
|
|
202
|
+
</IressPopover\>
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### Props
|
|
207
|
+
|
|
208
|
+
| Name | Description | Default | Control |
|
|
209
|
+
| --- | --- | --- | --- |
|
|
210
|
+
| activator\* |
|
|
211
|
+
Content for an activator element, usually an `IressButton`.
|
|
212
|
+
|
|
213
|
+
PopoverActivatorProps\['children'\]
|
|
214
|
+
|
|
215
|
+
| \- | \- |
|
|
216
|
+
| align |
|
|
217
|
+
|
|
218
|
+
Sets the alignment of the popover relative to the activator element.
|
|
219
|
+
|
|
220
|
+
FloatingUIAligns
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
|
225
|
+
|
|
226
|
+
'auto'
|
|
227
|
+
|
|
228
|
+
| Set object |
|
|
229
|
+
| children |
|
|
230
|
+
|
|
231
|
+
The content to render within the popover.
|
|
232
|
+
|
|
233
|
+
ReactNode
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
| \- | Choose option...nonehellobasicdetailsparagraphmenu |
|
|
238
|
+
| container |
|
|
239
|
+
|
|
240
|
+
The container element to render the popover into. By default, the popover will render where its parent is rendered.
|
|
241
|
+
|
|
242
|
+
**Note:** If the `container` doesn’t exist when the popover is mounted, ensure you pass an element directly (not a ref) and specify null as the default value before it is set. This lets it wait for the root to be available. For example, if you reference the parent element of a popover.
|
|
243
|
+
|
|
244
|
+
FloatingUIContainer
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
| \- | Set object |
|
|
249
|
+
| contentClassName |
|
|
250
|
+
|
|
251
|
+
Class name of the popover content.
|
|
252
|
+
|
|
253
|
+
string
|
|
254
|
+
|
|
255
|
+
<table class="css-3nr4py"><tbody><tr><td colspan="2"><strong>Deprecated</strong>: Use `contentStyle` instead.</td></tr></tbody></table>
|
|
256
|
+
|
|
257
|
+
| \- | Set string |
|
|
258
|
+
| contentStyle |
|
|
259
|
+
|
|
260
|
+
This allows you to customise the content styling specifically, which is the floating element. It accepts an object with any of the styling properties available on `IressCSSProps`, as well as `className` and `style`.
|
|
261
|
+
|
|
262
|
+
IressCustomiseSlot
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
| \- | Set object |
|
|
267
|
+
| defaultShow |
|
|
268
|
+
|
|
269
|
+
When set to `true` the popover will be visible by default. Use for uncontrolled popovers.
|
|
270
|
+
|
|
271
|
+
boolean
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
| \- | Set boolean |
|
|
276
|
+
| displayMode |
|
|
277
|
+
|
|
278
|
+
Sets the display mode of popover.
|
|
279
|
+
|
|
280
|
+
DisplayModes
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
|
285
|
+
|
|
286
|
+
'overlay'
|
|
287
|
+
|
|
288
|
+
| Set object |
|
|
289
|
+
| fluid |
|
|
290
|
+
|
|
291
|
+
Popovers can be fluid, meaning they will take up the full width of their container.
|
|
292
|
+
|
|
293
|
+
boolean
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
| \- | Set boolean |
|
|
298
|
+
| focusStartIndex |
|
|
299
|
+
|
|
300
|
+
Which index to start the focus on when the popover is opened. Only works with `type` listbox and menu. Note: The index must exist in the list of items, otherwise it will not work.
|
|
301
|
+
|
|
302
|
+
number
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
| \- | Set number |
|
|
307
|
+
| matchActivatorWidth |
|
|
308
|
+
|
|
309
|
+
Sets the popover to match the width of the activator. Note: This only works when `displayMode="overlay"`.
|
|
310
|
+
|
|
311
|
+
boolean
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
| \- | Set boolean |
|
|
316
|
+
| onActivated |
|
|
317
|
+
|
|
318
|
+
Is called when popover is activated.
|
|
319
|
+
|
|
320
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
321
|
+
|
|
322
|
+
| \- | \- |
|
|
323
|
+
| onDeactivated |
|
|
324
|
+
|
|
325
|
+
Is called when popover is deactivated.
|
|
326
|
+
|
|
327
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
328
|
+
|
|
329
|
+
| \- | \- |
|
|
330
|
+
| onNavigate |
|
|
331
|
+
|
|
332
|
+
Is called when registered popover items are navigated using arrow keys. Only works with `type` listbox and menu.
|
|
333
|
+
|
|
334
|
+
(activeIndex: number | null) => void
|
|
335
|
+
|
|
336
|
+
| \- | \- |
|
|
337
|
+
| show |
|
|
338
|
+
|
|
339
|
+
When set to `true` the modal will be visible. Use for controlled popovers.
|
|
340
|
+
|
|
341
|
+
boolean
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
| \- | Set boolean |
|
|
346
|
+
| type |
|
|
347
|
+
|
|
348
|
+
Describes the type of content contained in the popover.
|
|
349
|
+
|
|
350
|
+
PopoverHookReturn\['type'\]
|
|
351
|
+
|
|
352
|
+
| \- | Set object |
|
|
353
|
+
| virtualFocus |
|
|
354
|
+
|
|
355
|
+
Whether the focus is virtual (using `aria-activedescendant`). Use this if you need focus to remain on the reference element (such as an input), but allow arrow keys to navigate items. Note: This is only applicable when type is set to: `listbox` or `menu`, and only works out of the box with `IressMenu` and its subcomponents.
|
|
356
|
+
|
|
357
|
+
boolean
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
| \- | Set boolean |
|
|
362
|
+
|
|
363
|
+
### The `show` property
|
|
364
|
+
|
|
365
|
+
You can use state to control the popover by setting the `show` property to `true` or `false`. To sync your state with the popover, you can use the `onActivated` and `onDeactivated` prop.
|
|
366
|
+
|
|
367
|
+
[](./iframe.html?id=components-popover--show-with-state)
|
|
368
|
+
|
|
369
|
+
Show popover using state
|
|
370
|
+
|
|
371
|
+
A little more information about this area.
|
|
372
|
+
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
import {
|
|
376
|
+
IressButton,
|
|
377
|
+
IressPanel,
|
|
378
|
+
IressPopover,
|
|
379
|
+
type IressPopoverProps,
|
|
380
|
+
} from '@iress-oss/ids-components';
|
|
381
|
+
import { useState } from 'react';
|
|
382
|
+
export const PopoverUsingState \= () \=> {
|
|
383
|
+
const \[show, setShow\] \= useState(false);
|
|
384
|
+
return (
|
|
385
|
+
<IressPopover
|
|
386
|
+
|
|
387
|
+
activator\={
|
|
388
|
+
<IressButton onClick\={() \=> setShow(!show)}\>
|
|
389
|
+
Show popover using state </IressButton\>
|
|
390
|
+
}
|
|
391
|
+
show\={show}
|
|
392
|
+
onActivated\={() \=> setShow(true)}
|
|
393
|
+
onDeactivated\={() \=> setShow(false)}
|
|
394
|
+
\>
|
|
395
|
+
<IressPanel\>A little more information about this area.</IressPanel\>
|
|
396
|
+
</IressPopover\>
|
|
397
|
+
);
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
#### Props
|
|
403
|
+
|
|
404
|
+
| Name | Description | Default | Control |
|
|
405
|
+
| --- | --- | --- | --- |
|
|
406
|
+
| activator\* |
|
|
407
|
+
Content for an activator element, usually an `IressButton`.
|
|
408
|
+
|
|
409
|
+
PopoverActivatorProps\['children'\]
|
|
410
|
+
|
|
411
|
+
| \- | \- |
|
|
412
|
+
| align |
|
|
413
|
+
|
|
414
|
+
Sets the alignment of the popover relative to the activator element.
|
|
415
|
+
|
|
416
|
+
FloatingUIAligns
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
|
421
|
+
|
|
422
|
+
'auto'
|
|
423
|
+
|
|
424
|
+
| Set object |
|
|
425
|
+
| children |
|
|
426
|
+
|
|
427
|
+
The content to render within the popover.
|
|
428
|
+
|
|
429
|
+
ReactNode
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
| \- | \- |
|
|
434
|
+
| container |
|
|
435
|
+
|
|
436
|
+
The container element to render the popover into. By default, the popover will render where its parent is rendered.
|
|
437
|
+
|
|
438
|
+
**Note:** If the `container` doesn’t exist when the popover is mounted, ensure you pass an element directly (not a ref) and specify null as the default value before it is set. This lets it wait for the root to be available. For example, if you reference the parent element of a popover.
|
|
439
|
+
|
|
440
|
+
FloatingUIContainer
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
| \- | Set object |
|
|
445
|
+
| contentClassName |
|
|
446
|
+
|
|
447
|
+
Class name of the popover content.
|
|
448
|
+
|
|
449
|
+
string
|
|
450
|
+
|
|
451
|
+
<table class="css-3nr4py"><tbody><tr><td colspan="2"><strong>Deprecated</strong>: Use `contentStyle` instead.</td></tr></tbody></table>
|
|
452
|
+
|
|
453
|
+
| \- | Set string |
|
|
454
|
+
| contentStyle |
|
|
455
|
+
|
|
456
|
+
This allows you to customise the content styling specifically, which is the floating element. It accepts an object with any of the styling properties available on `IressCSSProps`, as well as `className` and `style`.
|
|
457
|
+
|
|
458
|
+
IressCustomiseSlot
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
| \- | Set object |
|
|
463
|
+
| defaultShow |
|
|
464
|
+
|
|
465
|
+
When set to `true` the popover will be visible by default. Use for uncontrolled popovers.
|
|
466
|
+
|
|
467
|
+
boolean
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
| \- | Set boolean |
|
|
472
|
+
| displayMode |
|
|
473
|
+
|
|
474
|
+
Sets the display mode of popover.
|
|
475
|
+
|
|
476
|
+
DisplayModes
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
|
481
|
+
|
|
482
|
+
'overlay'
|
|
483
|
+
|
|
484
|
+
| Set object |
|
|
485
|
+
| fluid |
|
|
486
|
+
|
|
487
|
+
Popovers can be fluid, meaning they will take up the full width of their container.
|
|
488
|
+
|
|
489
|
+
boolean
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
| \- | Set boolean |
|
|
494
|
+
| focusStartIndex |
|
|
495
|
+
|
|
496
|
+
Which index to start the focus on when the popover is opened. Only works with `type` listbox and menu. Note: The index must exist in the list of items, otherwise it will not work.
|
|
497
|
+
|
|
498
|
+
number
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
| \- | Set number |
|
|
503
|
+
| matchActivatorWidth |
|
|
504
|
+
|
|
505
|
+
Sets the popover to match the width of the activator. Note: This only works when `displayMode="overlay"`.
|
|
506
|
+
|
|
507
|
+
boolean
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
| \- | Set boolean |
|
|
512
|
+
| onActivated |
|
|
513
|
+
|
|
514
|
+
Is called when popover is activated.
|
|
515
|
+
|
|
516
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
517
|
+
|
|
518
|
+
| \- | \- |
|
|
519
|
+
| onDeactivated |
|
|
520
|
+
|
|
521
|
+
Is called when popover is deactivated.
|
|
522
|
+
|
|
523
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
524
|
+
|
|
525
|
+
| \- | \- |
|
|
526
|
+
| onNavigate |
|
|
527
|
+
|
|
528
|
+
Is called when registered popover items are navigated using arrow keys. Only works with `type` listbox and menu.
|
|
529
|
+
|
|
530
|
+
(activeIndex: number | null) => void
|
|
531
|
+
|
|
532
|
+
| \- | \- |
|
|
533
|
+
| show |
|
|
534
|
+
|
|
535
|
+
When set to `true` the modal will be visible. Use for controlled popovers.
|
|
536
|
+
|
|
537
|
+
boolean
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
| \- | \- |
|
|
542
|
+
| type |
|
|
543
|
+
|
|
544
|
+
Describes the type of content contained in the popover.
|
|
545
|
+
|
|
546
|
+
PopoverHookReturn\['type'\]
|
|
547
|
+
|
|
548
|
+
| \- | Set object |
|
|
549
|
+
| virtualFocus |
|
|
550
|
+
|
|
551
|
+
Whether the focus is virtual (using `aria-activedescendant`). Use this if you need focus to remain on the reference element (such as an input), but allow arrow keys to navigate items. Note: This is only applicable when type is set to: `listbox` or `menu`, and only works out of the box with `IressMenu` and its subcomponents.
|
|
552
|
+
|
|
553
|
+
boolean
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
| \- | Set boolean |
|
|
558
|
+
|
|
559
|
+
Behaviour
|
|
560
|
+
---------
|
|
561
|
+
|
|
562
|
+
* The popover is opened when the activator is pressed
|
|
563
|
+
* Once activated, the popover will set focus to popover content
|
|
564
|
+
* When the activator is pressed whilst the popover is open, it will close
|
|
565
|
+
* When the escape key is pressed while it is open, it will close
|
|
566
|
+
* When the popover panel loses focus, it will close
|
|
567
|
+
|
|
568
|
+
Examples
|
|
569
|
+
--------
|
|
570
|
+
|
|
571
|
+
### Align
|
|
572
|
+
|
|
573
|
+
The popover panel can be aligned in one of 12 positions relative to the activator element. The default value is `auto`.
|
|
574
|
+
|
|
575
|
+
The popover panel's position will change dynamically based on the amount of space available in it's container window, so that it doesn't overflow.
|
|
576
|
+
|
|
577
|
+
[](./iframe.html?id=components-popover--align)
|
|
578
|
+
|
|
579
|
+
top-start
|
|
580
|
+
|
|
581
|
+
Hello!
|
|
582
|
+
|
|
583
|
+
top
|
|
584
|
+
|
|
585
|
+
Hello!
|
|
586
|
+
|
|
587
|
+
top-end
|
|
588
|
+
|
|
589
|
+
Hello!
|
|
590
|
+
|
|
591
|
+
left-start
|
|
592
|
+
|
|
593
|
+
Hello!
|
|
594
|
+
|
|
595
|
+
left
|
|
596
|
+
|
|
597
|
+
Hello!
|
|
598
|
+
|
|
599
|
+
left-end
|
|
600
|
+
|
|
601
|
+
Hello!
|
|
602
|
+
|
|
603
|
+
right-start
|
|
604
|
+
|
|
605
|
+
Hello!
|
|
606
|
+
|
|
607
|
+
right
|
|
608
|
+
|
|
609
|
+
Hello!
|
|
610
|
+
|
|
611
|
+
right-end
|
|
612
|
+
|
|
613
|
+
Hello!
|
|
614
|
+
|
|
615
|
+
bottom-start
|
|
616
|
+
|
|
617
|
+
Hello!
|
|
618
|
+
|
|
619
|
+
bottom
|
|
620
|
+
|
|
621
|
+
Hello!
|
|
622
|
+
|
|
623
|
+
bottom-end
|
|
624
|
+
|
|
625
|
+
Hello!
|
|
626
|
+
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
<div
|
|
630
|
+
style\={{
|
|
631
|
+
padding: '80px 150px'
|
|
632
|
+
}}
|
|
633
|
+
\>
|
|
634
|
+
<IressStack gap\="md"\>
|
|
635
|
+
<IressInline
|
|
636
|
+
gap\="sm"
|
|
637
|
+
horizontalAlign\="center"
|
|
638
|
+
\>
|
|
639
|
+
<IressPopover
|
|
640
|
+
activator\={<IressTooltip align\="bottom-start" tooltipText\="Tooltips and popovers can go together if needed!"\><IressButton\>top-start</IressButton\></IressTooltip\>}
|
|
641
|
+
align\="top-start"
|
|
642
|
+
\>
|
|
643
|
+
<IressPanel\>
|
|
644
|
+
Hello! </IressPanel\>
|
|
645
|
+
</IressPopover\>
|
|
646
|
+
<IressPopover
|
|
647
|
+
activator\={<IressButton\>top</IressButton\>}
|
|
648
|
+
align\="top"
|
|
649
|
+
\>
|
|
650
|
+
<IressPanel\>
|
|
651
|
+
Hello! </IressPanel\>
|
|
652
|
+
</IressPopover\>
|
|
653
|
+
<IressPopover
|
|
654
|
+
activator\={<IressButton\>top-end</IressButton\>}
|
|
655
|
+
align\="top-end"
|
|
656
|
+
\>
|
|
657
|
+
<IressPanel\>
|
|
658
|
+
Hello! </IressPanel\>
|
|
659
|
+
</IressPopover\>
|
|
660
|
+
</IressInline\>
|
|
661
|
+
<IressInline horizontalAlign\="between"\>
|
|
662
|
+
<IressStack gap\="sm"\>
|
|
663
|
+
<IressInline horizontalAlign\="left"\>
|
|
664
|
+
<IressPopover
|
|
665
|
+
activator\={<IressButton\>left-start</IressButton\>}
|
|
666
|
+
align\="left-start"
|
|
667
|
+
\>
|
|
668
|
+
<IressPanel\>
|
|
669
|
+
Hello! </IressPanel\>
|
|
670
|
+
</IressPopover\>
|
|
671
|
+
</IressInline\>
|
|
672
|
+
<IressInline horizontalAlign\="left"\>
|
|
673
|
+
<IressPopover
|
|
674
|
+
activator\={<IressButton\>left</IressButton\>}
|
|
675
|
+
align\="left"
|
|
676
|
+
\>
|
|
677
|
+
<IressPanel\>
|
|
678
|
+
Hello! </IressPanel\>
|
|
679
|
+
</IressPopover\>
|
|
680
|
+
</IressInline\>
|
|
681
|
+
<IressInline horizontalAlign\="left"\>
|
|
682
|
+
<IressPopover
|
|
683
|
+
activator\={<IressButton\>left-end</IressButton\>}
|
|
684
|
+
align\="left-end"
|
|
685
|
+
\>
|
|
686
|
+
<IressPanel\>
|
|
687
|
+
Hello! </IressPanel\>
|
|
688
|
+
</IressPopover\>
|
|
689
|
+
</IressInline\>
|
|
690
|
+
</IressStack\>
|
|
691
|
+
<IressStack gap\="sm"\>
|
|
692
|
+
<IressInline horizontalAlign\="right"\>
|
|
693
|
+
<IressPopover
|
|
694
|
+
activator\={<IressButton\>right-start</IressButton\>}
|
|
695
|
+
align\="right-start"
|
|
696
|
+
\>
|
|
697
|
+
<IressPanel\>
|
|
698
|
+
Hello! </IressPanel\>
|
|
699
|
+
</IressPopover\>
|
|
700
|
+
</IressInline\>
|
|
701
|
+
<IressInline horizontalAlign\="right"\>
|
|
702
|
+
<IressPopover
|
|
703
|
+
activator\={<IressButton\>right</IressButton\>}
|
|
704
|
+
align\="right"
|
|
705
|
+
\>
|
|
706
|
+
<IressPanel\>
|
|
707
|
+
Hello! </IressPanel\>
|
|
708
|
+
</IressPopover\>
|
|
709
|
+
</IressInline\>
|
|
710
|
+
<IressInline horizontalAlign\="right"\>
|
|
711
|
+
<IressPopover
|
|
712
|
+
activator\={<IressButton\>right-end</IressButton\>}
|
|
713
|
+
align\="right-end"
|
|
714
|
+
\>
|
|
715
|
+
<IressPanel\>
|
|
716
|
+
Hello! </IressPanel\>
|
|
717
|
+
</IressPopover\>
|
|
718
|
+
</IressInline\>
|
|
719
|
+
</IressStack\>
|
|
720
|
+
</IressInline\>
|
|
721
|
+
<IressInline
|
|
722
|
+
gap\="sm"
|
|
723
|
+
horizontalAlign\="center"
|
|
724
|
+
\>
|
|
725
|
+
<IressPopover
|
|
726
|
+
activator\={<IressButton\>bottom-start</IressButton\>}
|
|
727
|
+
align\="bottom-start"
|
|
728
|
+
\>
|
|
729
|
+
<IressPanel\>
|
|
730
|
+
Hello! </IressPanel\>
|
|
731
|
+
</IressPopover\>
|
|
732
|
+
<IressPopover
|
|
733
|
+
activator\={<IressButton\>bottom</IressButton\>}
|
|
734
|
+
align\="bottom"
|
|
735
|
+
\>
|
|
736
|
+
<IressPanel\>
|
|
737
|
+
Hello! </IressPanel\>
|
|
738
|
+
</IressPopover\>
|
|
739
|
+
<IressPopover
|
|
740
|
+
activator\={<IressButton\>bottom-end</IressButton\>}
|
|
741
|
+
align\="bottom-end"
|
|
742
|
+
\>
|
|
743
|
+
<IressPanel\>
|
|
744
|
+
Hello! </IressPanel\>
|
|
745
|
+
</IressPopover\>
|
|
746
|
+
</IressInline\>
|
|
747
|
+
</IressStack\>
|
|
748
|
+
</div\>
|
|
749
|
+
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
#### Props
|
|
753
|
+
|
|
754
|
+
| Name | Description | Default | Control |
|
|
755
|
+
| --- | --- | --- | --- |
|
|
756
|
+
| activator\* |
|
|
757
|
+
Content for an activator element, usually an `IressButton`.
|
|
758
|
+
|
|
759
|
+
PopoverActivatorProps\['children'\]
|
|
760
|
+
|
|
761
|
+
| \- | \- |
|
|
762
|
+
| align |
|
|
763
|
+
|
|
764
|
+
Sets the alignment of the popover relative to the activator element.
|
|
765
|
+
|
|
766
|
+
FloatingUIAligns
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
|
|
|
771
|
+
|
|
772
|
+
'auto'
|
|
773
|
+
|
|
774
|
+
| \- |
|
|
775
|
+
| children |
|
|
776
|
+
|
|
777
|
+
The content to render within the popover.
|
|
778
|
+
|
|
779
|
+
ReactNode
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
| \- | Choose option...nonehellobasicdetailsparagraphmenu |
|
|
784
|
+
| container |
|
|
785
|
+
|
|
786
|
+
The container element to render the popover into. By default, the popover will render where its parent is rendered.
|
|
787
|
+
|
|
788
|
+
**Note:** If the `container` doesn’t exist when the popover is mounted, ensure you pass an element directly (not a ref) and specify null as the default value before it is set. This lets it wait for the root to be available. For example, if you reference the parent element of a popover.
|
|
789
|
+
|
|
790
|
+
FloatingUIContainer
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
| \- | Set object |
|
|
795
|
+
| contentClassName |
|
|
796
|
+
|
|
797
|
+
Class name of the popover content.
|
|
798
|
+
|
|
799
|
+
string
|
|
800
|
+
|
|
801
|
+
<table class="css-3nr4py"><tbody><tr><td colspan="2"><strong>Deprecated</strong>: Use `contentStyle` instead.</td></tr></tbody></table>
|
|
802
|
+
|
|
803
|
+
| \- | Set string |
|
|
804
|
+
| contentStyle |
|
|
805
|
+
|
|
806
|
+
This allows you to customise the content styling specifically, which is the floating element. It accepts an object with any of the styling properties available on `IressCSSProps`, as well as `className` and `style`.
|
|
807
|
+
|
|
808
|
+
IressCustomiseSlot
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
| \- | Set object |
|
|
813
|
+
| defaultShow |
|
|
814
|
+
|
|
815
|
+
When set to `true` the popover will be visible by default. Use for uncontrolled popovers.
|
|
816
|
+
|
|
817
|
+
boolean
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
| \- | Set boolean |
|
|
822
|
+
| displayMode |
|
|
823
|
+
|
|
824
|
+
Sets the display mode of popover.
|
|
825
|
+
|
|
826
|
+
DisplayModes
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
|
|
|
831
|
+
|
|
832
|
+
'overlay'
|
|
833
|
+
|
|
834
|
+
| Set object |
|
|
835
|
+
| fluid |
|
|
836
|
+
|
|
837
|
+
Popovers can be fluid, meaning they will take up the full width of their container.
|
|
838
|
+
|
|
839
|
+
boolean
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
| \- | Set boolean |
|
|
844
|
+
| focusStartIndex |
|
|
845
|
+
|
|
846
|
+
Which index to start the focus on when the popover is opened. Only works with `type` listbox and menu. Note: The index must exist in the list of items, otherwise it will not work.
|
|
847
|
+
|
|
848
|
+
number
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
| \- | Set number |
|
|
853
|
+
| matchActivatorWidth |
|
|
854
|
+
|
|
855
|
+
Sets the popover to match the width of the activator. Note: This only works when `displayMode="overlay"`.
|
|
856
|
+
|
|
857
|
+
boolean
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
| \- | Set boolean |
|
|
862
|
+
| onActivated |
|
|
863
|
+
|
|
864
|
+
Is called when popover is activated.
|
|
865
|
+
|
|
866
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
867
|
+
|
|
868
|
+
| \- | \- |
|
|
869
|
+
| onDeactivated |
|
|
870
|
+
|
|
871
|
+
Is called when popover is deactivated.
|
|
872
|
+
|
|
873
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
874
|
+
|
|
875
|
+
| \- | \- |
|
|
876
|
+
| onNavigate |
|
|
877
|
+
|
|
878
|
+
Is called when registered popover items are navigated using arrow keys. Only works with `type` listbox and menu.
|
|
879
|
+
|
|
880
|
+
(activeIndex: number | null) => void
|
|
881
|
+
|
|
882
|
+
| \- | \- |
|
|
883
|
+
| show |
|
|
884
|
+
|
|
885
|
+
When set to `true` the modal will be visible. Use for controlled popovers.
|
|
886
|
+
|
|
887
|
+
boolean
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
| \- | Set boolean |
|
|
892
|
+
| type |
|
|
893
|
+
|
|
894
|
+
Describes the type of content contained in the popover.
|
|
895
|
+
|
|
896
|
+
PopoverHookReturn\['type'\]
|
|
897
|
+
|
|
898
|
+
| \- | Set object |
|
|
899
|
+
| virtualFocus |
|
|
900
|
+
|
|
901
|
+
Whether the focus is virtual (using `aria-activedescendant`). Use this if you need focus to remain on the reference element (such as an input), but allow arrow keys to navigate items. Note: This is only applicable when type is set to: `listbox` or `menu`, and only works out of the box with `IressMenu` and its subcomponents.
|
|
902
|
+
|
|
903
|
+
boolean
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
| \- | Set boolean |
|
|
908
|
+
|
|
909
|
+
### Width
|
|
910
|
+
|
|
911
|
+
Occasionally, you may have more information to display than the width set by the theme can comfortably show.
|
|
912
|
+
|
|
913
|
+
[](./iframe.html?id=components-popover--width)
|
|
914
|
+
|
|
915
|
+
Toggle popover
|
|
916
|
+
|
|
917
|
+
```
|
|
918
|
+
|
|
919
|
+
<IressPopover
|
|
920
|
+
activator\={<IressButton\>Toggle popover</IressButton\>}
|
|
921
|
+
container\={document.body}
|
|
922
|
+
contentStyle\={{
|
|
923
|
+
style: {
|
|
924
|
+
maxWidth: '30rem'
|
|
925
|
+
}
|
|
926
|
+
}}
|
|
927
|
+
\>
|
|
928
|
+
<IressPanel\>
|
|
929
|
+
<IressRow\>
|
|
930
|
+
<IressCol span\={6}\>
|
|
931
|
+
<IressText\>
|
|
932
|
+
Client </IressText\>
|
|
933
|
+
<IressText noGutter\>
|
|
934
|
+
<ul\>
|
|
935
|
+
<li\>
|
|
936
|
+
Entity id 582323 </li\>
|
|
937
|
+
<li\>
|
|
938
|
+
Fruit Apple </li\>
|
|
939
|
+
<li\>
|
|
940
|
+
Preferred email mamaduke@gmail.com </li\>
|
|
941
|
+
</ul\>
|
|
942
|
+
</IressText\>
|
|
943
|
+
</IressCol\>
|
|
944
|
+
<IressCol span\={6}\>
|
|
945
|
+
<IressText\>
|
|
946
|
+
Client </IressText\>
|
|
947
|
+
<IressText noGutter\>
|
|
948
|
+
<ul\>
|
|
949
|
+
<li\>
|
|
950
|
+
Entity id 8766 </li\>
|
|
951
|
+
<li\>
|
|
952
|
+
Fruit Orange </li\>
|
|
953
|
+
<li\>
|
|
954
|
+
Preferred email felicity@yahoo.com </li\>
|
|
955
|
+
</ul\>
|
|
956
|
+
</IressText\>
|
|
957
|
+
</IressCol\>
|
|
958
|
+
</IressRow\>
|
|
959
|
+
</IressPanel\>
|
|
960
|
+
</IressPopover\>
|
|
961
|
+
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
#### Props
|
|
965
|
+
|
|
966
|
+
| Name | Description | Default | Control |
|
|
967
|
+
| --- | --- | --- | --- |
|
|
968
|
+
| activator\* |
|
|
969
|
+
Content for an activator element, usually an `IressButton`.
|
|
970
|
+
|
|
971
|
+
PopoverActivatorProps\['children'\]
|
|
972
|
+
|
|
973
|
+
| \- | \- |
|
|
974
|
+
| align |
|
|
975
|
+
|
|
976
|
+
Sets the alignment of the popover relative to the activator element.
|
|
977
|
+
|
|
978
|
+
FloatingUIAligns
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
|
|
|
983
|
+
|
|
984
|
+
'auto'
|
|
985
|
+
|
|
986
|
+
| Set object |
|
|
987
|
+
| children |
|
|
988
|
+
|
|
989
|
+
The content to render within the popover.
|
|
990
|
+
|
|
991
|
+
ReactNode
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
| \- | Choose option...nonehellobasicdetailsparagraphmenu |
|
|
996
|
+
| container |
|
|
997
|
+
|
|
998
|
+
The container element to render the popover into. By default, the popover will render where its parent is rendered.
|
|
999
|
+
|
|
1000
|
+
**Note:** If the `container` doesn’t exist when the popover is mounted, ensure you pass an element directly (not a ref) and specify null as the default value before it is set. This lets it wait for the root to be available. For example, if you reference the parent element of a popover.
|
|
1001
|
+
|
|
1002
|
+
FloatingUIContainer
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
| \- |
|
|
1007
|
+
|
|
1008
|
+
{}
|
|
1009
|
+
|
|
1010
|
+
|
|
|
1011
|
+
| contentClassName |
|
|
1012
|
+
|
|
1013
|
+
Class name of the popover content.
|
|
1014
|
+
|
|
1015
|
+
string
|
|
1016
|
+
|
|
1017
|
+
<table class="css-3nr4py"><tbody><tr><td colspan="2"><strong>Deprecated</strong>: Use `contentStyle` instead.</td></tr></tbody></table>
|
|
1018
|
+
|
|
1019
|
+
| \- | Set string |
|
|
1020
|
+
| contentStyle |
|
|
1021
|
+
|
|
1022
|
+
This allows you to customise the content styling specifically, which is the floating element. It accepts an object with any of the styling properties available on `IressCSSProps`, as well as `className` and `style`.
|
|
1023
|
+
|
|
1024
|
+
IressCustomiseSlot
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
| \- | Set object |
|
|
1029
|
+
| defaultShow |
|
|
1030
|
+
|
|
1031
|
+
When set to `true` the popover will be visible by default. Use for uncontrolled popovers.
|
|
1032
|
+
|
|
1033
|
+
boolean
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
| \- | Set boolean |
|
|
1038
|
+
| displayMode |
|
|
1039
|
+
|
|
1040
|
+
Sets the display mode of popover.
|
|
1041
|
+
|
|
1042
|
+
DisplayModes
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
|
|
|
1047
|
+
|
|
1048
|
+
'overlay'
|
|
1049
|
+
|
|
1050
|
+
| Set object |
|
|
1051
|
+
| fluid |
|
|
1052
|
+
|
|
1053
|
+
Popovers can be fluid, meaning they will take up the full width of their container.
|
|
1054
|
+
|
|
1055
|
+
boolean
|
|
1056
|
+
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
| \- | Set boolean |
|
|
1060
|
+
| focusStartIndex |
|
|
1061
|
+
|
|
1062
|
+
Which index to start the focus on when the popover is opened. Only works with `type` listbox and menu. Note: The index must exist in the list of items, otherwise it will not work.
|
|
1063
|
+
|
|
1064
|
+
number
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
| \- | Set number |
|
|
1069
|
+
| matchActivatorWidth |
|
|
1070
|
+
|
|
1071
|
+
Sets the popover to match the width of the activator. Note: This only works when `displayMode="overlay"`.
|
|
1072
|
+
|
|
1073
|
+
boolean
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
| \- | Set boolean |
|
|
1078
|
+
| onActivated |
|
|
1079
|
+
|
|
1080
|
+
Is called when popover is activated.
|
|
1081
|
+
|
|
1082
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
1083
|
+
|
|
1084
|
+
| \- | \- |
|
|
1085
|
+
| onDeactivated |
|
|
1086
|
+
|
|
1087
|
+
Is called when popover is deactivated.
|
|
1088
|
+
|
|
1089
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
1090
|
+
|
|
1091
|
+
| \- | \- |
|
|
1092
|
+
| onNavigate |
|
|
1093
|
+
|
|
1094
|
+
Is called when registered popover items are navigated using arrow keys. Only works with `type` listbox and menu.
|
|
1095
|
+
|
|
1096
|
+
(activeIndex: number | null) => void
|
|
1097
|
+
|
|
1098
|
+
| \- | \- |
|
|
1099
|
+
| show |
|
|
1100
|
+
|
|
1101
|
+
When set to `true` the modal will be visible. Use for controlled popovers.
|
|
1102
|
+
|
|
1103
|
+
boolean
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+
|
|
1107
|
+
| \- | \- |
|
|
1108
|
+
| type |
|
|
1109
|
+
|
|
1110
|
+
Describes the type of content contained in the popover.
|
|
1111
|
+
|
|
1112
|
+
PopoverHookReturn\['type'\]
|
|
1113
|
+
|
|
1114
|
+
| \- | Set object |
|
|
1115
|
+
| virtualFocus |
|
|
1116
|
+
|
|
1117
|
+
Whether the focus is virtual (using `aria-activedescendant`). Use this if you need focus to remain on the reference element (such as an input), but allow arrow keys to navigate items. Note: This is only applicable when type is set to: `listbox` or `menu`, and only works out of the box with `IressMenu` and its subcomponents.
|
|
1118
|
+
|
|
1119
|
+
boolean
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
| \- | Set boolean |
|
|
1124
|
+
| width |
|
|
1125
|
+
|
|
1126
|
+
\-
|
|
1127
|
+
|
|
1128
|
+
| \- | \- |
|
|
1129
|
+
|
|
1130
|
+
### Overflow
|
|
1131
|
+
|
|
1132
|
+
Popovers can contain a wide variety of different content, including components that use popovers themselves (like Combobox). This can cause issues with overflowing content, so by default we allow popovers to grow in height based on their content.
|
|
1133
|
+
|
|
1134
|
+
If you need to fix the height of a popover, you can set a maximum height using the `maxHeight` and `overflowY` css on your popover's `contentStyle` prop.
|
|
1135
|
+
|
|
1136
|
+
[](./iframe.html?id=components-popover--overflow)
|
|
1137
|
+
|
|
1138
|
+
Normal popover
|
|
1139
|
+
|
|
1140
|
+
Fixed height popover
|
|
1141
|
+
|
|
1142
|
+
```
|
|
1143
|
+
|
|
1144
|
+
<IressInline gap\="md"\>
|
|
1145
|
+
<IressPopover
|
|
1146
|
+
activator\={<IressButton\>Normal popover</IressButton\>}
|
|
1147
|
+
align\="bottom-start"
|
|
1148
|
+
container\={document.body}
|
|
1149
|
+
\>
|
|
1150
|
+
<IressPanel\>
|
|
1151
|
+
<IressText noGutter\>
|
|
1152
|
+
<p\>
|
|
1153
|
+
His head is gone, it is like it is been erased... Erased from existence. That was the day I invented time travel. I remember it vividly. I was standing on the edge of my toilet hanging a clock, the porces was wet, I slipped, hit my head on the edge of the sink. And when I came to I had a revelation, a picture, a picture in my head, a picture of this. This is what makes time travel possible. The flux capacitor. </p\>
|
|
1154
|
+
</IressText\>
|
|
1155
|
+
</IressPanel\>
|
|
1156
|
+
</IressPopover\>
|
|
1157
|
+
<IressPopover
|
|
1158
|
+
activator\={<IressButton\>Fixed height popover</IressButton\>}
|
|
1159
|
+
align\="bottom-start"
|
|
1160
|
+
container\={document.body}
|
|
1161
|
+
contentStyle\={{
|
|
1162
|
+
style: {
|
|
1163
|
+
maxHeight: '200px',
|
|
1164
|
+
overflowY: 'auto'
|
|
1165
|
+
}
|
|
1166
|
+
}}
|
|
1167
|
+
\>
|
|
1168
|
+
<IressPanel\>
|
|
1169
|
+
<IressText noGutter\>
|
|
1170
|
+
<p\>
|
|
1171
|
+
His head is gone, it is like it is been erased... Erased from existence. That was the day I invented time travel. I remember it vividly. I was standing on the edge of my toilet hanging a clock, the porces was wet, I slipped, hit my head on the edge of the sink. And when I came to I had a revelation, a picture, a picture in my head, a picture of this. This is what makes time travel possible. The flux capacitor. </p\>
|
|
1172
|
+
</IressText\>
|
|
1173
|
+
</IressPanel\>
|
|
1174
|
+
</IressPopover\>
|
|
1175
|
+
</IressInline\>
|
|
1176
|
+
|
|
1177
|
+
```
|
|
1178
|
+
|
|
1179
|
+
#### Props
|
|
1180
|
+
|
|
1181
|
+
| Name | Description | Default | Control |
|
|
1182
|
+
| --- | --- | --- | --- |
|
|
1183
|
+
| activator\* |
|
|
1184
|
+
Content for an activator element, usually an `IressButton`.
|
|
1185
|
+
|
|
1186
|
+
PopoverActivatorProps\['children'\]
|
|
1187
|
+
|
|
1188
|
+
| \- | \- |
|
|
1189
|
+
| align |
|
|
1190
|
+
|
|
1191
|
+
Sets the alignment of the popover relative to the activator element.
|
|
1192
|
+
|
|
1193
|
+
FloatingUIAligns
|
|
1194
|
+
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
|
|
|
1198
|
+
|
|
1199
|
+
'auto'
|
|
1200
|
+
|
|
1201
|
+
|
|
|
1202
|
+
|
|
1203
|
+
"bottom-start"
|
|
1204
|
+
|
|
1205
|
+
|
|
|
1206
|
+
| children |
|
|
1207
|
+
|
|
1208
|
+
The content to render within the popover.
|
|
1209
|
+
|
|
1210
|
+
ReactNode
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
| \- | Choose option...nonehellobasicdetailsparagraphmenu |
|
|
1215
|
+
| container |
|
|
1216
|
+
|
|
1217
|
+
The container element to render the popover into. By default, the popover will render where its parent is rendered.
|
|
1218
|
+
|
|
1219
|
+
**Note:** If the `container` doesn’t exist when the popover is mounted, ensure you pass an element directly (not a ref) and specify null as the default value before it is set. This lets it wait for the root to be available. For example, if you reference the parent element of a popover.
|
|
1220
|
+
|
|
1221
|
+
FloatingUIContainer
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
| \- |
|
|
1226
|
+
|
|
1227
|
+
{}
|
|
1228
|
+
|
|
1229
|
+
|
|
|
1230
|
+
| contentClassName |
|
|
1231
|
+
|
|
1232
|
+
Class name of the popover content.
|
|
1233
|
+
|
|
1234
|
+
string
|
|
1235
|
+
|
|
1236
|
+
<table class="css-3nr4py"><tbody><tr><td colspan="2"><strong>Deprecated</strong>: Use `contentStyle` instead.</td></tr></tbody></table>
|
|
1237
|
+
|
|
1238
|
+
| \- | Set string |
|
|
1239
|
+
| contentStyle |
|
|
1240
|
+
|
|
1241
|
+
This allows you to customise the content styling specifically, which is the floating element. It accepts an object with any of the styling properties available on `IressCSSProps`, as well as `className` and `style`.
|
|
1242
|
+
|
|
1243
|
+
IressCustomiseSlot
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
| \- | Set object |
|
|
1248
|
+
| defaultShow |
|
|
1249
|
+
|
|
1250
|
+
When set to `true` the popover will be visible by default. Use for uncontrolled popovers.
|
|
1251
|
+
|
|
1252
|
+
boolean
|
|
1253
|
+
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
| \- | Set boolean |
|
|
1257
|
+
| displayMode |
|
|
1258
|
+
|
|
1259
|
+
Sets the display mode of popover.
|
|
1260
|
+
|
|
1261
|
+
DisplayModes
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
|
|
1265
|
+
|
|
|
1266
|
+
|
|
1267
|
+
'overlay'
|
|
1268
|
+
|
|
1269
|
+
| Set object |
|
|
1270
|
+
| fluid |
|
|
1271
|
+
|
|
1272
|
+
Popovers can be fluid, meaning they will take up the full width of their container.
|
|
1273
|
+
|
|
1274
|
+
boolean
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
| \- | Set boolean |
|
|
1279
|
+
| focusStartIndex |
|
|
1280
|
+
|
|
1281
|
+
Which index to start the focus on when the popover is opened. Only works with `type` listbox and menu. Note: The index must exist in the list of items, otherwise it will not work.
|
|
1282
|
+
|
|
1283
|
+
number
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
|
|
1287
|
+
| \- | Set number |
|
|
1288
|
+
| matchActivatorWidth |
|
|
1289
|
+
|
|
1290
|
+
Sets the popover to match the width of the activator. Note: This only works when `displayMode="overlay"`.
|
|
1291
|
+
|
|
1292
|
+
boolean
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
| \- | Set boolean |
|
|
1297
|
+
| onActivated |
|
|
1298
|
+
|
|
1299
|
+
Is called when popover is activated.
|
|
1300
|
+
|
|
1301
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
1302
|
+
|
|
1303
|
+
| \- | \- |
|
|
1304
|
+
| onDeactivated |
|
|
1305
|
+
|
|
1306
|
+
Is called when popover is deactivated.
|
|
1307
|
+
|
|
1308
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
1309
|
+
|
|
1310
|
+
| \- | \- |
|
|
1311
|
+
| onNavigate |
|
|
1312
|
+
|
|
1313
|
+
Is called when registered popover items are navigated using arrow keys. Only works with `type` listbox and menu.
|
|
1314
|
+
|
|
1315
|
+
(activeIndex: number | null) => void
|
|
1316
|
+
|
|
1317
|
+
| \- | \- |
|
|
1318
|
+
| show |
|
|
1319
|
+
|
|
1320
|
+
When set to `true` the modal will be visible. Use for controlled popovers.
|
|
1321
|
+
|
|
1322
|
+
boolean
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
|
|
1326
|
+
| \- | Set boolean |
|
|
1327
|
+
| type |
|
|
1328
|
+
|
|
1329
|
+
Describes the type of content contained in the popover.
|
|
1330
|
+
|
|
1331
|
+
PopoverHookReturn\['type'\]
|
|
1332
|
+
|
|
1333
|
+
| \- | Set object |
|
|
1334
|
+
| virtualFocus |
|
|
1335
|
+
|
|
1336
|
+
Whether the focus is virtual (using `aria-activedescendant`). Use this if you need focus to remain on the reference element (such as an input), but allow arrow keys to navigate items. Note: This is only applicable when type is set to: `listbox` or `menu`, and only works out of the box with `IressMenu` and its subcomponents.
|
|
1337
|
+
|
|
1338
|
+
boolean
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
| \- | Set boolean |
|
|
1343
|
+
|
|
1344
|
+
### Container
|
|
1345
|
+
|
|
1346
|
+
By default, the popover will be rendered where its parent is rendered. If you need to render the popover in a different container, you can use the `container` prop.
|
|
1347
|
+
|
|
1348
|
+
**Note:** If the `container` doesn’t exist when the portal is mounted, ensure you pass an element directly (not a ref) and specify null as the default value before it is set. This lets it wait for the root to be available.
|
|
1349
|
+
|
|
1350
|
+
This will be the case when you are rendering into its parent container, which is not yet rendered when the popover is mounted. The example below shows how to use state instead of a reference to change where the popover is rendered.
|
|
1351
|
+
|
|
1352
|
+
[](./iframe.html?id=components-popover--parent-container)
|
|
1353
|
+
|
|
1354
|
+
Toggle
|
|
1355
|
+
|
|
1356
|
+
This content will be rendered in the parent container
|
|
1357
|
+
|
|
1358
|
+
```
|
|
1359
|
+
|
|
1360
|
+
export const PopoverParentContainer \= () \=> {
|
|
1361
|
+
const \[parentContainer, setParentContainer\] \= useState<HTMLDivElement | null\>(
|
|
1362
|
+
null,
|
|
1363
|
+
);
|
|
1364
|
+
return (
|
|
1365
|
+
<div id\="parent" ref\={setParentContainer}\>
|
|
1366
|
+
<IressPopover
|
|
1367
|
+
activator\={<IressButton\>Toggle</IressButton\>}
|
|
1368
|
+
container\={parentContainer}
|
|
1369
|
+
\>
|
|
1370
|
+
<IressPanel\>
|
|
1371
|
+
This content will be rendered in the parent container </IressPanel\>
|
|
1372
|
+
</IressPopover\>
|
|
1373
|
+
</div\>
|
|
1374
|
+
);
|
|
1375
|
+
};
|
|
1376
|
+
|
|
1377
|
+
```
|
|
1378
|
+
|
|
1379
|
+
#### Props
|
|
1380
|
+
|
|
1381
|
+
| Name | Description | Default | Control |
|
|
1382
|
+
| --- | --- | --- | --- |
|
|
1383
|
+
| activator\* |
|
|
1384
|
+
Content for an activator element, usually an `IressButton`.
|
|
1385
|
+
|
|
1386
|
+
PopoverActivatorProps\['children'\]
|
|
1387
|
+
|
|
1388
|
+
| \- | \- |
|
|
1389
|
+
| align |
|
|
1390
|
+
|
|
1391
|
+
Sets the alignment of the popover relative to the activator element.
|
|
1392
|
+
|
|
1393
|
+
FloatingUIAligns
|
|
1394
|
+
|
|
1395
|
+
|
|
1396
|
+
|
|
1397
|
+
|
|
|
1398
|
+
|
|
1399
|
+
'auto'
|
|
1400
|
+
|
|
1401
|
+
| Set object |
|
|
1402
|
+
| children |
|
|
1403
|
+
|
|
1404
|
+
The content to render within the popover.
|
|
1405
|
+
|
|
1406
|
+
ReactNode
|
|
1407
|
+
|
|
1408
|
+
|
|
1409
|
+
|
|
1410
|
+
| \- | Choose option...nonehellobasicdetailsparagraphmenu |
|
|
1411
|
+
| container |
|
|
1412
|
+
|
|
1413
|
+
The container element to render the popover into. By default, the popover will render where its parent is rendered.
|
|
1414
|
+
|
|
1415
|
+
**Note:** If the `container` doesn’t exist when the popover is mounted, ensure you pass an element directly (not a ref) and specify null as the default value before it is set. This lets it wait for the root to be available. For example, if you reference the parent element of a popover.
|
|
1416
|
+
|
|
1417
|
+
FloatingUIContainer
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
|
|
1421
|
+
| \- | Set object |
|
|
1422
|
+
| contentClassName |
|
|
1423
|
+
|
|
1424
|
+
Class name of the popover content.
|
|
1425
|
+
|
|
1426
|
+
string
|
|
1427
|
+
|
|
1428
|
+
<table class="css-3nr4py"><tbody><tr><td colspan="2"><strong>Deprecated</strong>: Use `contentStyle` instead.</td></tr></tbody></table>
|
|
1429
|
+
|
|
1430
|
+
| \- | Set string |
|
|
1431
|
+
| contentStyle |
|
|
1432
|
+
|
|
1433
|
+
This allows you to customise the content styling specifically, which is the floating element. It accepts an object with any of the styling properties available on `IressCSSProps`, as well as `className` and `style`.
|
|
1434
|
+
|
|
1435
|
+
IressCustomiseSlot
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
|
|
1439
|
+
| \- | Set object |
|
|
1440
|
+
| defaultShow |
|
|
1441
|
+
|
|
1442
|
+
When set to `true` the popover will be visible by default. Use for uncontrolled popovers.
|
|
1443
|
+
|
|
1444
|
+
boolean
|
|
1445
|
+
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
| \- | Set boolean |
|
|
1449
|
+
| displayMode |
|
|
1450
|
+
|
|
1451
|
+
Sets the display mode of popover.
|
|
1452
|
+
|
|
1453
|
+
DisplayModes
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
|
|
1457
|
+
|
|
|
1458
|
+
|
|
1459
|
+
'overlay'
|
|
1460
|
+
|
|
1461
|
+
| Set object |
|
|
1462
|
+
| fluid |
|
|
1463
|
+
|
|
1464
|
+
Popovers can be fluid, meaning they will take up the full width of their container.
|
|
1465
|
+
|
|
1466
|
+
boolean
|
|
1467
|
+
|
|
1468
|
+
|
|
1469
|
+
|
|
1470
|
+
| \- | Set boolean |
|
|
1471
|
+
| focusStartIndex |
|
|
1472
|
+
|
|
1473
|
+
Which index to start the focus on when the popover is opened. Only works with `type` listbox and menu. Note: The index must exist in the list of items, otherwise it will not work.
|
|
1474
|
+
|
|
1475
|
+
number
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
|
|
1479
|
+
| \- | Set number |
|
|
1480
|
+
| matchActivatorWidth |
|
|
1481
|
+
|
|
1482
|
+
Sets the popover to match the width of the activator. Note: This only works when `displayMode="overlay"`.
|
|
1483
|
+
|
|
1484
|
+
boolean
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
|
|
1488
|
+
| \- | Set boolean |
|
|
1489
|
+
| onActivated |
|
|
1490
|
+
|
|
1491
|
+
Is called when popover is activated.
|
|
1492
|
+
|
|
1493
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
1494
|
+
|
|
1495
|
+
| \- | \- |
|
|
1496
|
+
| onDeactivated |
|
|
1497
|
+
|
|
1498
|
+
Is called when popover is deactivated.
|
|
1499
|
+
|
|
1500
|
+
( e?: Event, reason?: OpenChangeReason, activeIndex?: number | null, ) => void
|
|
1501
|
+
|
|
1502
|
+
| \- | \- |
|
|
1503
|
+
| onNavigate |
|
|
1504
|
+
|
|
1505
|
+
Is called when registered popover items are navigated using arrow keys. Only works with `type` listbox and menu.
|
|
1506
|
+
|
|
1507
|
+
(activeIndex: number | null) => void
|
|
1508
|
+
|
|
1509
|
+
| \- | \- |
|
|
1510
|
+
| show |
|
|
1511
|
+
|
|
1512
|
+
When set to `true` the modal will be visible. Use for controlled popovers.
|
|
1513
|
+
|
|
1514
|
+
boolean
|
|
1515
|
+
|
|
1516
|
+
|
|
1517
|
+
|
|
1518
|
+
| \- | Set boolean |
|
|
1519
|
+
| type |
|
|
1520
|
+
|
|
1521
|
+
Describes the type of content contained in the popover.
|
|
1522
|
+
|
|
1523
|
+
PopoverHookReturn\['type'\]
|
|
1524
|
+
|
|
1525
|
+
| \- | Set object |
|
|
1526
|
+
| virtualFocus |
|
|
1527
|
+
|
|
1528
|
+
Whether the focus is virtual (using `aria-activedescendant`). Use this if you need focus to remain on the reference element (such as an input), but allow arrow keys to navigate items. Note: This is only applicable when type is set to: `listbox` or `menu`, and only works out of the box with `IressMenu` and its subcomponents.
|
|
1529
|
+
|
|
1530
|
+
boolean
|
|
1531
|
+
|
|
1532
|
+
|
|
1533
|
+
|
|
1534
|
+
| \- | Set boolean |
|
|
1535
|
+
|
|
1536
|
+
`IressInputPopover`
|
|
1537
|
+
-------------------
|
|
1538
|
+
|
|
1539
|
+
If you need a popover that is triggered by input changes, you can use the `IressInputPopover` component. This component has an additional `minLength` prop that allows you to specify the minimum number of characters required before the popover is shown.
|
|
1540
|
+
|
|
1541
|
+
### Behaviour
|
|
1542
|
+
|
|
1543
|
+
Input popovers work slightly different to normal popovers, where the focus inside the popover is **virtual**. This means that the popover content will act as if it is in focus, but the input will still be the actual focus.
|
|
1544
|
+
|
|
1545
|
+
* The popover is opened when the input has content that meets the `minLength` requirement
|
|
1546
|
+
* The popover is closed when the input no longer meets the `minLength` requirement
|
|
1547
|
+
* Once activated, virtual focus will be set to the popover content if it contains a menu (e.g. items will highlight as if in focus, but the user can still type in the input)
|
|
1548
|
+
* When the `minLength` is 0, it will open on focus
|
|
1549
|
+
* When the escape key is pressed while it is open, it will close
|
|
1550
|
+
* When the input loses focus, it will close
|
|
1551
|
+
|
|
1552
|
+
[](./iframe.html?id=components-popover-inputpopover--activator)
|
|
1553
|
+
|
|
1554
|
+
```
|
|
1555
|
+
|
|
1556
|
+
<IressInputPopover
|
|
1557
|
+
activator\={<IressInput />}
|
|
1558
|
+
container\={document.body}
|
|
1559
|
+
\>
|
|
1560
|
+
<IressPanel\>
|
|
1561
|
+
A little more information about this area. </IressPanel\>
|
|
1562
|
+
</IressInputPopover\>
|
|
1563
|
+
|
|
1564
|
+
```
|
|
1565
|
+
|
|
1566
|
+
#### Props
|
|
1567
|
+
|
|
1568
|
+
| Name | Description | Default | Control |
|
|
1569
|
+
| --- | --- | --- | --- |
|
|
1570
|
+
| activator\* |
|
|
1571
|
+
Content for an activator element, usually an `IressInput`.
|
|
1572
|
+
|
|
1573
|
+
InputPopoverActivatorProps\['children'\]
|
|
1574
|
+
|
|
1575
|
+
| \- | \- |
|
|
1576
|
+
| align |
|
|
1577
|
+
|
|
1578
|
+
|
|
|
1579
|
+
|
|
1580
|
+
'auto'
|
|
1581
|
+
|
|
1582
|
+
| Set object |
|
|
1583
|
+
| autoHighlight |
|
|
1584
|
+
|
|
1585
|
+
If true, the first supported is automatically highlighted.
|
|
1586
|
+
|
|
1587
|
+
boolean
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
|
|
1591
|
+
|
|
|
1592
|
+
|
|
1593
|
+
true
|
|
1594
|
+
|
|
1595
|
+
| Set boolean |
|
|
1596
|
+
| children |
|
|
1597
|
+
|
|
1598
|
+
string
|
|
1599
|
+
|
|
1600
|
+
|
|
1601
|
+
|
|
1602
|
+
| \- | Choose option...nonebasicmenu |
|
|
1603
|
+
| container |
|
|
1604
|
+
|
|
1605
|
+
object
|
|
1606
|
+
|
|
1607
|
+
|
|
1608
|
+
|
|
1609
|
+
| \- |
|
|
1610
|
+
|
|
1611
|
+
{}
|
|
1612
|
+
|
|
1613
|
+
|
|
|
1614
|
+
| displayMode |
|
|
1615
|
+
|
|
1616
|
+
|
|
|
1617
|
+
|
|
1618
|
+
'overlay'
|
|
1619
|
+
|
|
1620
|
+
| Set object |
|
|
1621
|
+
| type |
|
|
1622
|
+
|
|
1623
|
+
Describes the type of content contained in the popover. If `listbox`, it will add the combobox role to the popover activator.
|
|
1624
|
+
|
|
1625
|
+
IressPopoverProps\['type'\]
|
|
1626
|
+
|
|
1627
|
+
|
|
|
1628
|
+
|
|
1629
|
+
'listbox'
|
|
1630
|
+
|
|
1631
|
+
| Set object |
|