Angular Dropdown Single button

Here's how you can put them to work with either <button> elements:

The best part is you can do this with any button variant, too:

@for (color of colors; track color; let i = $index) {

}
Angular Dropdown Split button

Similarly, create split button dropdowns with virtually the same markup as single button dropdowns, but with the addition of boolean prop split for proper spacing around the dropdown caret.

We use this extra class to reduce the horizontal padding on either side of the caret by 25% and remove the margin-left that's attached for normal button dropdowns. Those additional changes hold the caret centered in the split button and implement a more properly sized hit area next to the main button.

@for (color of colors; track color; let i = $index) {

}
Angular Dropdown Sizing

Button dropdowns work with buttons of all sizes, including default and split dropdown buttons.





Angular Dropdown dark

Opt into darker dropdowns to match a dark navbar or custom style by set dark property. No changes are required to the dropdown items.


And putting it to use in a navbar:

Navbar
Home Link Dropdown

Disabled
Angular Dropdown Dropup

Trigger dropdown menus above elements by adding direction="dropup" to the <c-dropdown> component.



Angular Dropdown Dropright

Trigger dropdown menus at the right of the elements by adding direction="dropend" to the <c-dropdown> component.



Angular Dropdown Dropleft

Trigger dropdown menus at the left of the elements by adding direction="dropstart" to the <c-dropdown> component.


Angular Dropdown Centered

Trigger dropdown menus centered below the toggle by adding direction="center" to the c-dropdown component.