forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContextualMenu.Section.Example.tsx
71 lines (68 loc) · 1.48 KB
/
ContextualMenu.Section.Example.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import * as React from 'react';
import {
ContextualMenuItemType,
IContextualMenuProps,
IContextualMenuItem,
} from '@fluentui/react-next/lib/ContextualMenu';
import { DefaultButton } from '@fluentui/react-next/lib/compat/Button';
export const ContextualMenuSectionExample: React.FunctionComponent = () => {
return <DefaultButton text="Click for ContextualMenu" menuProps={menuProps} />;
};
const menuItems: IContextualMenuItem[] = [
{
key: 'section1',
itemType: ContextualMenuItemType.Section,
sectionProps: {
topDivider: true,
bottomDivider: true,
title: 'Actions',
items: [
{
key: 'newItem',
text: 'New',
},
{
key: 'deleteItem',
text: 'Delete',
},
],
},
},
{
key: 'section2',
itemType: ContextualMenuItemType.Section,
sectionProps: {
title: 'Social',
items: [
{
key: 'share',
text: 'Share',
},
{
key: 'print',
text: 'Print',
},
{
key: 'music',
text: 'Music',
},
],
},
},
{
key: 'section3',
itemType: ContextualMenuItemType.Section,
sectionProps: {
title: 'Navigation',
items: [
{
key: 'Bing',
text: 'Go to Bing',
href: 'http://www.bing.com',
target: '_blank',
},
],
},
},
];
const menuProps: IContextualMenuProps = { items: menuItems };