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
* Title for the menu component. In a managed flyout context, the title is used to indicate the flyout session for history navigation.
89
87
*/
90
88
title?: React.ReactNode;
91
89
/**
92
-
* Hides the title in the flyout menu bar.
93
-
* If the flyout is used in a managed flyout session as a "main" flyout, the default will be true, as main flyouts typically show a title in an EuiFlyoutHeader instead.
94
-
* @default true for main flyout in managed flyout session; false otherwise
90
+
* Hides the title in the `EuiFlyoutMenu`. This is useful when the title is already shown in an `EuiFlyoutHeader`.
91
+
* @default true for main flyout in a managed flyout session; false otherwise
95
92
*/
96
93
hideTitle?: boolean;
97
94
/**
98
-
* Hides the close button in the menu header
95
+
* Hides the close button in the menu component
99
96
* @default false
100
97
*/
101
98
hideCloseButton?: boolean;
102
99
/**
103
-
* Shows a back button in the menu header
100
+
* Shows a back button in the menu component
104
101
* @default false
105
102
*/
106
103
showBackButton?: boolean;
@@ -113,7 +110,7 @@ export type EuiFlyoutMenuProps = CommonProps &
113
110
*/
114
111
historyItems?: EuiFlyoutHistoryItem[];
115
112
/**
116
-
* List of custom action items for the menu header
113
+
* List of custom action items for the menu component
Copy file name to clipboardExpand all lines: packages/website/docs/components/containers/flyout/session-management.mdx
+44-13Lines changed: 44 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,12 +39,17 @@ export default () => {
39
39
<EuiFlyout
40
40
session="start"
41
41
size="s"
42
-
aria-label="Flyout A - main"
43
-
flyoutMenuProps={{
44
-
title: 'Welcome to the flyout session management journey!',
45
-
}}
42
+
aria-labelledby="welcomeHeading"
43
+
flyoutMenuProps={{ title: 'Welcome' }}
46
44
onClose={() =>setIsOpenFlyoutA(false)}
47
45
>
46
+
<EuiFlyoutHeader>
47
+
<EuiTitle>
48
+
<h2id="welcomeHeading">
49
+
Welcome to the flyout session management journey!
50
+
</h2>
51
+
</EuiTitle>
52
+
</EuiFlyoutHeader>
48
53
<EuiFlyoutBody>
49
54
<EuiText>This flyout is rendered with the <EuiCode>{'session="start"'}</EuiCode> prop set which creates a new flyout session and marks this flyout as main.</EuiText>
50
55
<EuiSpacer />
@@ -60,12 +65,17 @@ export default () => {
60
65
<EuiFlyout
61
66
session="start"
62
67
size="m"
63
-
aria-label="Flyout B - main"
64
-
flyoutMenuProps={{
65
-
title: <>Glad to meet you, {name||'stranger'}!</>,
66
-
}}
68
+
aria-labelledby="flyoutBHeading"
69
+
flyoutMenuProps={{ title: 'Flyout B' }}
67
70
onClose={() =>setIsOpenFlyoutB(false)}
68
71
>
72
+
<EuiFlyoutHeader>
73
+
<EuiTitle>
74
+
<h2id="flyoutBHeading">
75
+
Glad to meet you, {name||'stranger'}!
76
+
</h2>
77
+
</EuiTitle>
78
+
</EuiFlyoutHeader>
69
79
<EuiFlyoutBody>
70
80
<EuiText>
71
81
This flyout is also rendered with the <EuiCode>{'session="start"'}</EuiCode> prop added which creates a <strong>second flyout session</strong> and marks this flyout as main in that session.
@@ -119,9 +129,19 @@ All bindings and configuration will be handled automatically.
119
129
120
130
### Session title
121
131
122
-
Flyout sessions within the managed system require a title that can be
123
-
referenced in the history navigation features. Use the `title`
124
-
field of the `flyoutMenuProps` to set the title of the flyout.
132
+
Managed flyout sessions require a title that can be referenced in the history
133
+
navigation features. Use the `title` field of the `flyoutMenuProps` to set the
134
+
title of the flyout session. If `flyoutMenuProps` is omitted or a `title` field
135
+
is not given in `flyoutMenuProps`, the manager will use the `aria-label`
136
+
attribute of `EuiFlyout` as the source for the session's title. If no source
137
+
for a title is given, a default title will be provided.
138
+
139
+
:::info Note
140
+
The "main" flyout in a session should use `EuiFlyoutHeader` for the actual
141
+
flyout heading. For this reason, the `title` given from `flyoutMenuProps` will
142
+
not be visible to end users. However, a title is still needed for the history
143
+
navigation feature of the flyout session management system.
144
+
:::
125
145
126
146
```tsx
127
147
{/* Render a new main flyout and create a flyout session */}
@@ -130,17 +150,28 @@ field of the `flyoutMenuProps` to set the title of the flyout.
130
150
flyoutMenuProps={{
131
151
title: 'My main flyout'
132
152
}}
153
+
aria-labelledby="myFlyoutHeading"
133
154
>
155
+
<EuiFlyoutHeader>
156
+
<EuiTitle>
157
+
<h2id="myFlyoutHeading">
158
+
I'm the main flyout heading
159
+
</h2>
160
+
</EuiTitle>
161
+
</EuiFlyoutHeader>
134
162
<EuiFlyoutBody>
135
-
I'm the main flyout
163
+
I'm the main flyout body
136
164
</EuiFlyoutBody>
137
165
{/* Render a new child flyout - notice the lack of the `session` prop */}
138
166
<EuiFlyout
139
167
flyoutMenuProps={{
140
168
title: 'My child flyout'
141
169
}}
142
170
>
143
-
I'm the child flyout that belongs to the same session as the main flyout
171
+
{/* Render a child flyout contents. Notice the lack of the EuiFlyoutHeader component - the child flyout menu shows the title from flyoutMenuProps */}
172
+
<EuiFlyoutBody>
173
+
I'm the child flyout that belongs to the same session as the main flyout
0 commit comments