Skip to main content
🏠ComponentsDropdown

Dropdown

The dropdown component is a container for a dropdown-trigger and a dropdown-overlay.

  • dropdown-trigger is the container for a button.
  • dropdown-overlay the togglable container for a menu, hidden by default, with a white background and a shadow.
<Dropdown>
<DropdownTrigger>
<Button>Dropdown button</Button>
</DropdownTrigger>
<DropdownOverlay>
<MenuItemList>
<MenuItem>
<MenuItemLabel>Menu Item</MenuItemLabel>
</MenuItem>
<MenuItem>
<MenuItemLabel>Menu Item</MenuItemLabel>
</MenuItem>
<MenuItem>
<MenuItemLabel>Menu Item</MenuItemLabel>
</MenuItem>
</MenuItemList>
</DropdownOverlay>
</Dropdown>

You are able to implement inside a DropdownOverlay a menu item list, a paragraph or whatever.

You can insert any type of content within the dropdown overlay.

<Dropdown visible>
<DropdownTrigger>
<Button>Dropdown button</Button>
</DropdownTrigger>
<DropdownOverlay>
<Typography component="body-2" classes="p-m"
>You can insert any type of content within the dropdown
overlay.</Typography
>
</DropdownOverlay>
</Dropdown>

Visible

You can use visible attribute to display dropdown-overlay.

<Dropdown visible> ... </Dropdown>

Placement

You can set top-center, top-right, top-left, bottom-center, bottom-right and bottom-left to placement property to place the dropdown overlay. By default the placement is bottom-left.

The dropdown is bottom left aligned.

<Dropdown visible placement="bottom-left"> ... </Dropdown>

The dropdown is center left aligned.

<Dropdown visible placement="bottom-center"> ... </Dropdown>

The dropdown is bottom right aligned.

<Dropdown visible placement="bottom-right"> ... </Dropdown>

The dropdown is top left aligned.

<Dropdown visible placement="top-left"> ... </Dropdown>

The dropdown is top center aligned.

<Dropdown visible placement="top-center"> ... </Dropdown>

The dropdown is top right aligned.

<Dropdown visible placement="top-right"> ... </Dropdown>

Customize style

Add your own classes in the classes attribute. This way you will be able to override or extend the styles applied to the component (you can use available utility classes by importing @qtm/css/dist/utilities.css).

API

Loading API documentation...
Loading API documentation...
Loading API documentation...