-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(MenuToggle): allow split action toggle text (#10256)
* feat(MenuToggle): allow split action toggle text * use var
- Loading branch information
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...t-core/src/components/MenuToggle/examples/MenuToggleSplitButtonCheckboxWithToggleText.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react'; | ||
import { MenuToggleCheckbox, MenuToggle } from '@patternfly/react-core'; | ||
|
||
export const MenuToggleSplitButtonCheckboxWithToggleText: React.FunctionComponent = () => ( | ||
<React.Fragment> | ||
<MenuToggle | ||
splitButtonOptions={{ | ||
items: [ | ||
<MenuToggleCheckbox | ||
id="split-button-checkbox-with-text-example" | ||
key="split-checkbox-with-text" | ||
aria-label="Select all" | ||
/> | ||
] | ||
}} | ||
aria-label="Menu toggle with checkbox split button and text" | ||
> | ||
10 selected | ||
</MenuToggle>{' '} | ||
<MenuToggle | ||
variant="primary" | ||
splitButtonOptions={{ | ||
items: [ | ||
<MenuToggleCheckbox | ||
id="split-button-checkbox-primary-example" | ||
key="split-checkbox-primary" | ||
aria-label="Select all" | ||
/> | ||
] | ||
}} | ||
aria-label="Primary menu toggle with checkbox split button" | ||
> | ||
10 selected | ||
</MenuToggle>{' '} | ||
<MenuToggle | ||
variant="secondary" | ||
splitButtonOptions={{ | ||
items: [ | ||
<MenuToggleCheckbox | ||
id="split-button-checkbox-secondary-example" | ||
key="split-checkbox-secondary" | ||
aria-label="Select all" | ||
/> | ||
] | ||
}} | ||
aria-label="Secondary menu toggle with checkbox split button" | ||
> | ||
10 selected | ||
</MenuToggle> | ||
</React.Fragment> | ||
); |