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:
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.
Button dropdowns work with buttons of all sizes, including default and split dropdown buttons.
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:
Trigger dropdown menus above elements by adding
direction="dropup" to the
<CDropdown>
component.
Trigger dropdown menus at the right of the elements by adding
direction="dropend" to the
<CDropdown>
component.
Trigger dropdown menus at the left of the elements by adding
direction="dropstart" to the
<CDropdown>
component.