forked from muicss/mui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdropdowns.html
More file actions
98 lines (87 loc) · 2.85 KB
/
dropdowns.html
File metadata and controls
98 lines (87 loc) · 2.85 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- for example only -->
<script src="../assets/vendor/react/15.2.1/react.js"></script>
<script src="../assets/vendor/react/15.2.1/react-dom.js"></script>
<script src="../assets/vendor/babel-core/5.8.23/browser.min.js"></script>
<!-- end -->
<link rel="stylesheet" type="text/css" href="../assets/mui/css/mui.css"/>
<script src="../assets/mui/react/mui-react.js"></script>
</head>
<body>
<div class="mui-container">
<h1>Dropdowns</h1>
<div id="dropdowns"></div>
</div>
<script type="text/babel">
let Dropdown = mui.react.Dropdown,
DropdownItem = mui.react.DropdownItem;
class DropdownExample1 extends React.Component {
render() {
return (
<Dropdown
color="primary"
label="Dropdown"
onClick={function() {console.log('toggle clicked')}}
onSelect={function(val) {console.log(val);}}
>
<DropdownItem value="a" link="#/link1">Option 1</DropdownItem>
<DropdownItem value="b" target="_blank">Option 2</DropdownItem>
<DropdownItem value="c">Option 3</DropdownItem>
<DropdownItem
value="d"
onClick={function() {alert("Option 4 selected");}}
>
Option 4
</DropdownItem>
</Dropdown>
);
}
}
class DropdownExample2 extends React.Component {
render() {
return (
<Dropdown
color="primary"
alignMenu="right"
label="Dropdown">
<DropdownItem>Option 1</DropdownItem>
<DropdownItem>Option 2</DropdownItem>
<DropdownItem>Option 3</DropdownItem>
<DropdownItem>Option 4</DropdownItem>
</Dropdown>
);
}
}
class DropdownExample3 extends React.Component {
render() {
let labelEl = <i>test</i>;
return (
<Dropdown
color="primary"
alignMenu="right"
label={labelEl}>
<DropdownItem>Option 1</DropdownItem>
<DropdownItem>Option 2</DropdownItem>
<DropdownItem>Option 3</DropdownItem>
<DropdownItem>Option 4</DropdownItem>
</Dropdown>
);
}
}
ReactDOM.render(
<div className="mui-panel">
<h2>React</h2>
<DropdownExample1 />
<DropdownExample2 />
<DropdownExample3 />
</div>,
document.getElementById('dropdowns')
);
</script>
</body>
</html>