Skip to main content
Parsley Design Systems logoParsley Design System - sample

Dropdown menu

Examples

Default - items as object

Code

1<DropdownMenu label="A content revealing button" width="m" items={[
2 { text: 'A First name', onClick: () => {} },
3 { text: 'Email address', href: 'http://www.google.com.au', onClick: () => {} },
4 { id: 'counry-of-origin', text: 'Country of Origin', onClick: () => {} },
5]} />

Output as MenuItem component children

Code

1<DropdownMenu label="A content revealing button" width="m">
2 <MenuItem onClick={() => {}}>this is 1</MenuItem>
3 <MenuItem onClick={() => {}} href="https://www.google.com">this is 2</MenuItem>
4 <MenuItem onClick={() => {}}>this is 3</MenuItem>
5 <MenuItem onClick={() => {}}>this is 4</MenuItem>
6</DropdownMenu>

Icons only display

Code

1<DropdownMenu label="A content revealing button" width="m" labelHidden>
2 <MenuItem onClick={() => {}}>this is 1</MenuItem>
3 <MenuItem onClick={() => {}} href="https://www.google.com">this is 2</MenuItem>
4 <MenuItem onClick={() => {}}>this is 3</MenuItem>
5 <MenuItem onClick={() => {}}>this is 4</MenuItem>
6</DropdownMenu>
7
8<DropdownMenu label="A content revealing button" width="m" iconType="more" labelHidden>
9 <MenuItem onClick={() => {}}>this is 1</MenuItem>
10 <MenuItem onClick={() => {}} href="https://www.google.com">this is 2</MenuItem>
11 <MenuItem onClick={() => {}}>this is 3</MenuItem>
12 <MenuItem onClick={() => {}}>this is 4</MenuItem>
13</DropdownMenu>

Different sizes

Code

1<DropdownMenu label="A content revealing button" width="m" size="small">
2 ...
3</DropdownMenu>
4
5<DropdownMenu label="A content revealing button" width="m" size="default">
6 ...
7</DropdownMenu>
8
9<DropdownMenu label="A content revealing button" width="m" size="large">
10 ...
11</DropdownMenu>
12
13<DropdownMenu label="A content revealing button" width="m" size="xlarge">
14 ...
15</DropdownMenu>

Different menu sizes

Code

1<DropdownMenu label="A content revealing button" width="m" menuSize="small">
2 ...
3</DropdownMenu>
4
5<DropdownMenu label="A content revealing button" width="m">
6 ...
7</DropdownMenu>
8
9<DropdownMenu label="A content revealing button" width="m" menuSize="large">
10 ...
11</DropdownMenu>

Different widths

Code

1<DropdownMenu label="A content revealing button" width="small">
2 ...
3</DropdownMenu>
4
5<DropdownMenu label="A content revealing button">
6 ...
7</DropdownMenu>
8
9<DropdownMenu label="A content revealing button" width="large">
10 ...
11</DropdownMenu>
12
13<DropdownMenu label="A content revealing button" width="xlarge">
14 ...
15</DropdownMenu>

Different border widths

Code

1<DropdownMenu label="A content revealing button" borderWidth="small">
2 ...
3</DropdownMenu>
4
5<DropdownMenu label="A content revealing button">
6 ...
7</DropdownMenu>

Open menu by default

Code

1<DropdownMenu label="A content revealing button" open>
2 ...
3</DropdownMenu>

Disabled control

Code

1<DropdownMenu label="A content revealing button" disabled>
2 ...
3</DropdownMenu>

Disabled menu items

Code

1<DropdownMenu label="A content revealing button">
2 <MenuItem disabled onClick={() => {}}>this is 3</MenuItem>
3</DropdownMenu>

Menu button context

Code

1<DropdownMenu label="A content revealing button" labelContext="menu button context here">
2 ...
3</DropdownMenu>