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
When a user selects a toggle, it becomes expanded and is styled with a blue underline. To flag expanded toggles, and apply expanded styling, use the `isExpanded` property .
To create a "settings" menu toggle that will animate on hover and focus, you can pass the `isSettings` property in. Doing so will override the `icon` property, as a specific icon is used internally for the animations.
76
57
77
-
```ts file="./MenuToggleSettings.tsx"
58
+
```ts file="MenuToggleSettings.tsx"
78
59
79
60
```
80
61
@@ -84,7 +65,7 @@ To add a recognizable icon to a menu toggle, use the `icon` property. The follow
84
65
85
66
For most basic icons, it is recommended to wrap it inside our [icon component](/components/icon).
86
67
87
-
```ts file="./MenuToggleCustomIcon.tsx"
68
+
```ts file="MenuToggleCustomIcon.tsx"
88
69
89
70
```
90
71
@@ -94,37 +75,14 @@ You can also pass images into the `icon` property. The following example passes
94
75
95
76
This can be used alongside a text label that provides more context for the image.
96
77
97
-
```ts
98
-
import { Fragment } from 'react';
99
-
import { MenuToggle, Avatar } from '@patternfly/react-core';
100
-
import imgAvatar from '@patternfly/react-core/src/components/assets/avatarImg.svg';
Variant styling can be applied to menu toggles. In the following example, the toggle uses primary styling by passing `variant="primary"` into the `<MenuToggle>` component. Additional variant options include “default”, “plain”, “plainText”, “secondary”, and “typeahead”.
To apply plain styling to a menu toggle with a text label, pass in `variant="plainText"`. Unlike the “plain” variant, “plainText” adds a caret pointing down in the toggle.
0 commit comments