Support CoreUI Development

CoreUI is an MIT-licensed open source project and is completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing.

You can support our Open Source software development in the following ways:

  • Buy the CoreUI PRO, and get access to PRO components, and dedicated support.
  • Hire Us! We create stunning designs, high-conversion landing pages, functional mobile apps and reliable web services – everything you need to offer your products or services online and always stay a tap away from your customers.
  • Give us a star ⭐️ on Github.

React Dropdown Component

React dropdown component allows you to toggle contextual overlays for displaying lists, links, and more html elements.

Other frameworks

CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and Vue components. To learn more please visit the following pages.

Overview#

Dropdowns are toggleable, contextual overlays for displaying lists of links and more.

Dropdowns are built on a third party library, Popper.js, which provides dynamic positioning and viewport detection. Popper.js isn't used to position dropdowns in navbars though as dynamic positioning isn't required.

Examples#

Bind the dropdown's toggle and the dropdown menu inside <CDropdown>, or different element that declares position: relative;. Dropdowns can be triggered from <a> or <button> elements to better fit your possible requirements.

Single button#

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

1<CDropdown>
2 <CDropdownToggle color="secondary">Dropdown button</CDropdownToggle>
3 <CDropdownMenu>
4 <CDropdownItem href="#">Action</CDropdownItem>
5 <CDropdownItem href="#">Another action</CDropdownItem>
6 <CDropdownItem href="#">Something else here</CDropdownItem>
7 </CDropdownMenu>
8</CDropdown>

And with <a> elements:

1<CDropdown>
2 <CDropdownToggle href="#" color="secondary">
3 Dropdown button
4 </CDropdownToggle>
5 <CDropdownMenu>
6 <CDropdownItem href="#">Action</CDropdownItem>
7 <CDropdownItem href="#">Another action</CDropdownItem>
8 <CDropdownItem href="#">Something else here</CDropdownItem>
9 </CDropdownMenu>
10</CDropdown>

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

1<>
2 {['primary', 'secondary', 'success', 'info', 'warning', 'danger'].map((color, index) => (
3 <CDropdown variant="btn-group" key={index}>
4 <CDropdownToggle color={color}>{color}</CDropdownToggle>
5 <CDropdownMenu>
6 <CDropdownItem href="#">Action</CDropdownItem>
7 <CDropdownItem href="#">Another action</CDropdownItem>
8 <CDropdownItem href="#">Something else here</CDropdownItem>
9 <CDropdownDivider />
10 <CDropdownItem href="#">Separated link</CDropdownItem>
11 </CDropdownMenu>
12 </CDropdown>
13 ))}
14</>

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.

1<>
2 {['primary', 'secondary', 'success', 'info', 'warning', 'danger'].map((color, index) => (
3 <CDropdown variant="btn-group" key={index}>
4 <CButton color={color}>{color}</CButton>
5 <CDropdownToggle color={color} split />
6 <CDropdownMenu>
7 <CDropdownItem href="#">Action</CDropdownItem>
8 <CDropdownItem href="#">Another action</CDropdownItem>
9 <CDropdownItem href="#">Something else here</CDropdownItem>
10 <CDropdownDivider />
11 <CDropdownItem href="#">Separated link</CDropdownItem>
12 </CDropdownMenu>
13 </CDropdown>
14 ))}
15</>

Sizing#

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

1<CDropdown variant="btn-group">
2 <CDropdownToggle color="secondary" size="lg">Large button</CDropdownToggle>
3 <CDropdownMenu>
4 <CDropdownItem href="#">Action</CDropdownItem>
5 <CDropdownItem href="#">Another action</CDropdownItem>
6 <CDropdownItem href="#">Something else here</CDropdownItem>
7 <CDropdownDivider/>
8 <CDropdownItem href="#">Separated link</CDropdownItem>
9 </CDropdownMenu>
10 </CDropdown>
11
12 <CDropdown variant="btn-group">
13 <CButton color="secondary" size="lg">Large split button</CButton>
14 <CDropdownToggle color="secondary" size="lg" split/>
15 <CDropdownMenu>
16 <CDropdownItem href="#">Action</CDropdownItem>
17 <CDropdownItem href="#">Another action</CDropdownItem>
18 <CDropdownItem href="#">Something else here</CDropdownItem>
19 <CDropdownDivider/>
20 <CDropdownItem href="#">Separated link</CDropdownItem>
21 </CDropdownMenu>
22 </CDropdown>
1<CDropdown variant="btn-group">
2 <CDropdownToggle color="secondary" size="sm">Small button</CDropdownToggle>
3 <CDropdownMenu>
4 <CDropdownItem href="#">Action</CDropdownItem>
5 <CDropdownItem href="#">Another action</CDropdownItem>
6 <CDropdownItem href="#">Something else here</CDropdownItem>
7 <CDropdownDivider/>
8 <CDropdownItem href="#">Separated link</CDropdownItem>
9 </CDropdownMenu>
10 </CDropdown>
11
12 <CDropdown variant="btn-group">
13 <CButton color="secondary" size="sm">Small split button</CButton>
14 <CDropdownToggle color="secondary" size="sm"split/>
15 <CDropdownMenu>
16 <CDropdownItem href="#">Action</CDropdownItem>
17 <CDropdownItem href="#">Another action</CDropdownItem>
18 <CDropdownItem href="#">Something else here</CDropdownItem>
19 <CDropdownDivider/>
20 <CDropdownItem href="#">Separated link</CDropdownItem>
21 </CDropdownMenu>
22 </CDropdown>

Dark dropdowns#

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

1<CDropdown dark>
2 <CDropdownToggle color="secondary">Dropdown button</CDropdownToggle>
3 <CDropdownMenu>
4 <CDropdownItem href="#">Action</CDropdownItem>
5 <CDropdownItem href="#">Another action</CDropdownItem>
6 <CDropdownItem href="#">Something else here</CDropdownItem>
7 <CDropdownDivider />
8 <CDropdownItem href="#">Separated link</CDropdownItem>
9 </CDropdownMenu>
10</CDropdown>

And putting it to use in a navbar:

1<CNavbar expand="lg" colorScheme="dark" className="bg-dark">
2 <CContainer fluid>
3 <CNavbarBrand href="#">Navbar</CNavbarBrand>
4 <CNavbarToggler aria-label="Toggle navigation" aria-expanded={true} />
5 <CCollapse className="navbar-collapse" visible={true}>
6 <CNavbarNav>
7 <CDropdown dark component="li" variant="nav-item">
8 <CDropdownToggle>Dropdown</CDropdownToggle>
9 <CDropdownMenu>
10 <CDropdownItem href="#">Action</CDropdownItem>
11 <CDropdownItem href="#">Another action</CDropdownItem>
12 <CDropdownItem href="#">Something else here</CDropdownItem>
13 <CDropdownDivider />
14 <CDropdownItem href="#">Separated link</CDropdownItem>
15 </CDropdownMenu>
16 </CDropdown>
17 </CNavbarNav>
18 </CCollapse>
19 </CContainer>
20</CNavbar>

Directions#

RTL

Directions are mirrored when using CoreUI in RTL, meaning `.dropstart` will appear on the right side.

Centered#

Make the dropdown menu centered below the toggle by adding direction="center" to the <CDropdown> component.

1<CDropdown variant="btn-group" direction="center">
2 <CDropdownToggle color="secondary">Centered dropdown</CDropdownToggle>
3 <CDropdownMenu>
4 <CDropdownItem href="#">Action</CDropdownItem>
5 <CDropdownItem href="#">Another action</CDropdownItem>
6 <CDropdownItem href="#">Something else here</CDropdownItem>
7 <CDropdownDivider/>
8 <CDropdownItem href="#">Separated link</CDropdownItem>
9 </CDropdownMenu>
10</CDropdown>

Dropup#

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

1<CDropdown variant="btn-group" direction="dropup">
2 <CDropdownToggle color="secondary">Dropdown</CDropdownToggle>
3 <CDropdownMenu>
4 <CDropdownItem href="#">Action</CDropdownItem>
5 <CDropdownItem href="#">Another action</CDropdownItem>
6 <CDropdownItem href="#">Something else here</CDropdownItem>
7 <CDropdownDivider/>
8 <CDropdownItem href="#">Separated link</CDropdownItem>
9 </CDropdownMenu>
10 </CDropdown>
11
12 <CDropdown variant="btn-group" direction="dropup">
13 <CButton color="secondary" >Small split button</CButton>
14 <CDropdownToggle color="secondary" split/>
15 <CDropdownMenu>
16 <CDropdownItem href="#">Action</CDropdownItem>
17 <CDropdownItem href="#">Another action</CDropdownItem>
18 <CDropdownItem href="#">Something else here</CDropdownItem>
19 <CDropdownDivider/>
20 <CDropdownItem href="#">Separated link</CDropdownItem>
21 </CDropdownMenu>
22 </CDropdown>

Dropup centered#

Make the dropup menu centered above the toggle by adding direction="dropup-center" to the <CDropdown> component.

1<CDropdown variant="btn-group" direction="dropup-center">
2 <CDropdownToggle color="secondary">Centered dropup</CDropdownToggle>
3 <CDropdownMenu>
4 <CDropdownItem href="#">Action</CDropdownItem>
5 <CDropdownItem href="#">Another action</CDropdownItem>
6 <CDropdownItem href="#">Something else here</CDropdownItem>
7 <CDropdownDivider/>
8 <CDropdownItem href="#">Separated link</CDropdownItem>
9 </CDropdownMenu>
10</CDropdown>

Dropright#

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

1<CDropdown variant="btn-group" direction="dropend">
2 <CDropdownToggle color="secondary">Dropdown</CDropdownToggle>
3 <CDropdownMenu>
4 <CDropdownItem href="#">Action</CDropdownItem>
5 <CDropdownItem href="#">Another action</CDropdownItem>
6 <CDropdownItem href="#">Something else here</CDropdownItem>
7 <CDropdownDivider/>
8 <CDropdownItem href="#">Separated link</CDropdownItem>
9 </CDropdownMenu>
10 </CDropdown>
11
12 <CDropdown variant="btn-group" direction="dropend">
13 <CButton color="secondary" >Small split button</CButton>
14 <CDropdownToggle color="secondary" split/>
15 <CDropdownMenu>
16 <CDropdownItem href="#">Action</CDropdownItem>
17 <CDropdownItem href="#">Another action</CDropdownItem>
18 <CDropdownItem href="#">Something else here</CDropdownItem>
19 <CDropdownDivider/>
20 <CDropdownItem href="#">Separated link</CDropdownItem>
21 </CDropdownMenu>
22 </CDropdown>

Dropleft#

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

1<CDropdown variant="btn-group" direction="dropstart">
2 <CDropdownToggle color="secondary">Dropdown</CDropdownToggle>
3 <CDropdownMenu>
4 <CDropdownItem href="#">Action</CDropdownItem>
5 <CDropdownItem href="#">Another action</CDropdownItem>
6 <CDropdownItem href="#">Something else here</CDropdownItem>
7 <CDropdownDivider/>
8 <CDropdownItem href="#">Separated link</CDropdownItem>
9 </CDropdownMenu>
10 </CDropdown>
11
12 <CButtonGroup>
13 <CDropdown variant="btn-group" direction="dropstart">
14 <CDropdownToggle color="secondary" split/>
15 <CDropdownMenu>
16 <CDropdownItem href="#">Action</CDropdownItem>
17 <CDropdownItem href="#">Another action</CDropdownItem>
18 <CDropdownItem href="#">Something else here</CDropdownItem>
19 <CDropdownDivider/>
20 <CDropdownItem href="#">Separated link</CDropdownItem>
21 </CDropdownMenu>
22 </CDropdown>
23 <CButton color="secondary" >Small split button</CButton>
24 </CButtonGroup>

Historically dropdown menu contents had to be links, but that's no longer the case with v4. Now you can optionally use <button> elements in your dropdowns instead of just <a>s.

1<CDropdown>
2 <CDropdownToggle color="secondary">Dropdown</CDropdownToggle>
3 <CDropdownMenu>
4 <CDropdownItem component="button">Action</CDropdownItem>
5 <CDropdownItem component="button">Another action</CDropdownItem>
6 <CDropdownItem component="button">Something else here</CDropdownItem>
7 <CDropdownDivider />
8 <CDropdownItem component="button">Separated link</CDropdownItem>
9 </CDropdownMenu>
10</CDropdown>

You can also create non-interactive dropdown items with <CDropdownItemPlain>.

1<div className="border rounded py-2">
2 <CDropdownItemPlain>Dropdown item text</CDropdownItemPlain>
3 <CDropdownItem href="#">Action</CDropdownItem>
4 <CDropdownItem href="#">Another action</CDropdownItem>
5 <CDropdownItem href="#">Something else here</CDropdownItem>
6</div>

Active#

Set boolean property active to style item as active.

In the following example we use div instead of <CDropdownMenu> to show <CDropdownMenu> content.

1<div className="border rounded py-2">
2 <CDropdownItem href="#">Regular link</CDropdownItem>
3 <CDropdownItem href="#" active>
4 Active link
5 </CDropdownItem>
6 <CDropdownItem href="#">Another link</CDropdownItem>
7</div>

Disabled#

Add disabled boolean property to items in the dropdown to style them as disabled.

In the following example we use div instead of <CDropdownMenu> to show <CDropdownMenu> content.

1<div className="border rounded py-2">
2 <CDropdownItem href="#">Regular link</CDropdownItem>
3 <CDropdownItem href="#" disabled>
4 Disabled link
5 </CDropdownItem>
6 <CDropdownItem href="#">Another link</CDropdownItem>
7</div>

By default, a dropdown menu is automatically positioned 100% from the top and along the left side of its parent. Add aligment="end" to right align the dropdown menu.

Heads up! Dropdowns are positioned thanks to Popper.
1<CDropdown alignment="end">
2 <CDropdownToggle color="secondary">Right-aligned menu example</CDropdownToggle>
3 <CDropdownMenu>
4 <CDropdownItem href="#">Action</CDropdownItem>
5 <CDropdownItem href="#">Another action</CDropdownItem>
6 <CDropdownItem href="#">Something else here</CDropdownItem>
7 <CDropdownDivider />
8 <CDropdownItem href="#">Separated link</CDropdownItem>
9 </CDropdownMenu>
10</CDropdown>

Responsive alignment#

If you use responsive alignment, dynamic positioning is disabled.

To align right the dropdown menu with the given breakpoint or larger, add aligment="xs|sm|md|lg|xl|xxl: end".

1<CDropdown alignment={{ lg: 'end' }}>
2 <CDropdownToggle color="secondary">
3 Left-aligned but right aligned when large screen
4 </CDropdownToggle>
5 <CDropdownMenu>
6 <CDropdownItem href="#">Action</CDropdownItem>
7 <CDropdownItem href="#">Another action</CDropdownItem>
8 <CDropdownItem href="#">Something else here</CDropdownItem>
9 <CDropdownDivider />
10 <CDropdownItem href="#">Separated link</CDropdownItem>
11 </CDropdownMenu>
12</CDropdown>

To align left the dropdown menu with the given breakpoint or larger, add aligment="xs|sm|md|lg|xl|xxl: start".

1<CDropdown alignment={{ xs: 'end', lg: 'start' }}>
2 <CDropdownToggle color="secondary">
3 Right-aligned but left aligned when large screen
4 </CDropdownToggle>
5 <CDropdownMenu>
6 <CDropdownItem href="#">Action</CDropdownItem>
7 <CDropdownItem href="#">Another action</CDropdownItem>
8 <CDropdownItem href="#">Something else here</CDropdownItem>
9 <CDropdownDivider />
10 <CDropdownItem href="#">Separated link</CDropdownItem>
11 </CDropdownMenu>
12</CDropdown>

Headers#

Add a header to label sections of actions in any dropdown menu.

In the following example we use div instead of <CDropdownMenu> to show <CDropdownMenu> content.

ActionAnother action
1<div className="border rounded py-2">
2 <CDropdownHeader>Dropdown header</CDropdownHeader>
3 <CDropdownItem href="#">Action</CDropdownItem>
4 <CDropdownItem href="#">Another action</CDropdownItem>
5</div>

Dividers#

Separate groups of related menu items with a divider.

In the following example we use div instead of <CDropdownMenu> to show <CDropdownMenu> content.

1<div className="border rounded py-2">
2 <CDropdownItem href="#">Action</CDropdownItem>
3 <CDropdownItem href="#">Another action</CDropdownItem>
4 <CDropdownItem href="#">Something else here</CDropdownItem>
5 <CDropdownDivider />
6 <CDropdownItem href="#">Separated link</CDropdownItem>
7</div>

Text#

Place any freeform text within a dropdown menu with text. Note that you'll likely need additional sizing styles to constrain the menu width.

Some example text that's free-flowing within the dropdown menu.

And this is more example text.

1<div className="border rounded p-4 text-medium-emphasis" style={{ maxWidth: '200px' }}>
2 <p>Some example text that's free-flowing within the dropdown menu.</p>
3 <p className="mb-0">And this is more example text.</p>
4</div>

Forms#

Put a form within a dropdown menu, or make it into a dropdown menu.

New around here? Sign upForgot password?
1<div className="border rounded py-2">
2 <CForm className="px-4 py-4">
3 <div className="mb-3">
4 <CFormLabel htmlFor="exampleDropdownFormEmail1">Email address</CFormLabel>
5 <CFormInput type="email" id="exampleDropdownFormEmail1" placeholder="[email protected]" />
6 </div>
7 <div className="mb-3">
8 <CFormLabel htmlFor="exampleDropdownFormPassword1">Password</CFormLabel>
9 <CFormInput type="password" id="exampleDropdownFormPassword1" placeholder="Password" />
10 </div>
11 <div className="mb-3">
12 <CFormCheck id="dropdownCheck" label="Remember me" />
13 </div>
14 <CButton type="submit">Sign in</CButton>
15 </CForm>
16 <CDropdownDivider />
17 <CDropdownItem href="#">New around here? Sign up</CDropdownItem>
18 <CDropdownItem href="#">Forgot password?</CDropdownItem>
19</div>

Customizing#

CSS variables#

React dropdowns use local CSS variables on .dropdown for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.

1--cui-dropdown-min-width: #{$dropdown-min-width};
2--cui-dropdown-padding-x: #{$dropdown-padding-x};
3--cui-dropdown-padding-y: #{$dropdown-padding-y};
4--cui-dropdown-spacer: #{$dropdown-spacer};
5--cui-dropdown-font-size: #{$dropdown-font-size};
6--cui-dropdown-color: #{$dropdown-color};
7--cui-dropdown-bg: #{$dropdown-bg};
8--cui-dropdown-border-color: #{$dropdown-border-color};
9--cui-dropdown-border-radius: #{$dropdown-border-radius};
10--cui-dropdown-border-width: #{$dropdown-border-width};
11--cui-dropdown-inner-border-radius: #{$dropdown-inner-border-radius};
12--cui-dropdown-divider-bg: #{$dropdown-divider-bg};
13--cui-dropdown-divider-margin-y: #{$dropdown-divider-margin-y};
14--cui-dropdown-box-shadow: #{$dropdown-box-shadow};
15--cui-dropdown-link-color: #{$dropdown-link-color};
16--cui-dropdown-link-hover-color: #{$dropdown-link-hover-color};
17--cui-dropdown-link-hover-bg: #{$dropdown-link-hover-bg};
18--cui-dropdown-link-active-color: #{$dropdown-link-active-color};
19--cui-dropdown-link-active-bg: #{$dropdown-link-active-bg};
20--cui-dropdown-link-disabled-color: #{$dropdown-link-disabled-color};
21--cui-dropdown-item-padding-x: #{$dropdown-item-padding-x};
22--cui-dropdown-item-padding-y: #{$dropdown-item-padding-y};
23--cui-dropdown-header-color: #{$dropdown-header-color};
24--cui-dropdown-header-padding-x: #{$dropdown-header-padding-x};
25--cui-dropdown-header-padding-y: #{$dropdown-header-padding-y};

Customization through CSS variables can be seen on the .dropdown-menu-dark class where we override specific values without adding duplicate CSS selectors.

1--cui-dropdown-color: #{$dropdown-dark-color};
2--cui-dropdown-bg: #{$dropdown-dark-bg};
3--cui-dropdown-border-color: #{$dropdown-dark-border-color};
4--cui-dropdown-box-shadow: #{$dropdown-dark-box-shadow};
5--cui-dropdown-link-color: #{$dropdown-dark-link-color};
6--cui-dropdown-link-hover-color: #{$dropdown-dark-link-hover-color};
7--cui-dropdown-divider-bg: #{$dropdown-dark-divider-bg};
8--cui-dropdown-link-hover-bg: #{$dropdown-dark-link-hover-bg};
9--cui-dropdown-link-active-color: #{$dropdown-dark-link-active-color};
10--cui-dropdown-link-active-bg: #{$dropdown-dark-link-active-bg};
11--cui-dropdown-link-disabled-color: #{$dropdown-dark-link-disabled-color};
12--cui-dropdown-header-color: #{$dropdown-dark-header-color};

How to use CSS variables#

1const vars = {
2 '--my-css-var': 10,
3 '--my-another-css-var': "red"
4}
5return <CDropdown style={vars}>...</CDropdown>

SASS variables#

1$dropdown-min-width: 10rem;
2$dropdown-padding-x: 0;
3$dropdown-padding-y: .5rem;
4$dropdown-spacer: .125rem;
5$dropdown-font-size: $font-size-base;
6$dropdown-color: $body-color;
7$dropdown-bg: $white;
8$dropdown-border-color: var(--cui-border-color-translucent);
9$dropdown-border-radius: $border-radius;
10$dropdown-border-width: $border-width;
11$dropdown-inner-border-radius: subtract($dropdown-border-radius, $dropdown-border-width);
12$dropdown-divider-bg: $dropdown-border-color;
13$dropdown-divider-margin-y: $spacer * .5;
14$dropdown-box-shadow: $box-shadow;
15
16$dropdown-link-color: $gray-900;
17$dropdown-link-hover-color: shade-color($dropdown-link-color, 10%);
18$dropdown-link-hover-bg: $gray-200;
19
20$dropdown-link-active-color: $component-active-color;
21$dropdown-link-active-bg: $component-active-bg;
22
23$dropdown-link-disabled-color: $gray-500;
24
25$dropdown-item-padding-y: $spacer * .25;
26$dropdown-item-padding-x: $spacer;
27
28$dropdown-header-color: $gray-600;
29$dropdown-header-padding-x: $dropdown-item-padding-x;
30$dropdown-header-padding-y: $dropdown-padding-y;
31// fusv-disable
32$dropdown-header-padding: $dropdown-header-padding-y $dropdown-header-padding-x; // Deprecated in v4.2.0
33// fusv-enable

API#

CDropdown#

1import { CDropdown } from '@coreui/react'
2// or
3import CDropdown from '@coreui/react/src/components/dropdown/CDropdown'
PropertyDescriptionTypeDefault
alignmentSet aligment of dropdown menu.'start' | 'end' | { xs: 'start' | 'end' } | { sm: 'start' | 'end' } | { md: 'start' | 'end' } | { lg: 'start' | 'end' } | { xl: 'start' | 'end'} | { xxl: 'start' | 'end'}-
autoCloseConfigure the auto close behavior of the dropdown:
- true - the dropdown will be closed by clicking outside or inside the dropdown menu.
- false - the dropdown will be closed by clicking the toggle button and manually calling hide or toggle method. (Also will not be closed by pressing esc key)
- 'inside' - the dropdown will be closed (only) by clicking inside the dropdown menu.
- 'outside' - the dropdown will be closed (only) by clicking outside the dropdown menu.
boolean | 'inside' | 'outside'true
classNameA string of all className you want applied to the base component.string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>div
darkSets a darker color scheme to match a dark navbar.boolean-
directionSets a specified direction and location of the dropdown menu.'center' | 'dropup' | 'dropup-center' | 'dropend' | 'dropstart'-
onHideCallback fired when the component requests to be hidden.() => void-
onShowCallback fired when the component requests to be shown.() => void-
placementDescribes the placement of your component after Popper.js has applied all the modifiers that may have flipped or altered the originally provided placement property.'auto' | 'top-end' | 'top' | 'top-start' | 'bottom-end' | 'bottom' | 'bottom-start' | 'right-start' | 'right' | 'right-end' | 'left-start' | 'left' | 'left-end'bottom-start
popperIf you want to disable dynamic positioning set this property to true.booleantrue
variantSet the dropdown variant to an btn-group, dropdown, input-group, and nav-item.'btn-group' | 'dropdown' | 'input-group' | 'nav-item'btn-group
visibleToggle the visibility of dropdown menu component.booleanfalse

CDropdownDivider#

1import { CDropdownDivider } from '@coreui/react'
2// or
3import CDropdownDivider from '@coreui/react/src/components/dropdown/CDropdownDivider'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the component.string-

CDropdownHeader#

1import { CDropdownHeader } from '@coreui/react'
2// or
3import CDropdownHeader from '@coreui/react/src/components/dropdown/CDropdownHeader'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the component.string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>-

CDropdownItem#

1import { CDropdownItem } from '@coreui/react'
2// or
3import CDropdownItem from '@coreui/react/src/components/dropdown/CDropdownItem'
PropertyDescriptionTypeDefault
activeToggle the active state for the component.boolean-
classNameA string of all className you want applied to the component.string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>a
disabledToggle the disabled state for the component.boolean-
hrefThe href attribute specifies the URL of the page the link goes to.string-

CDropdownItemPlain#

1import { CDropdownItemPlain } from '@coreui/react'
2// or
3import CDropdownItemPlain from '@coreui/react/src/components/dropdown/CDropdownItemPlain'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the component.string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>-

CDropdownMenu#

1import { CDropdownMenu } from '@coreui/react'
2// or
3import CDropdownMenu from '@coreui/react/src/components/dropdown/CDropdownMenu'
PropertyDescriptionTypeDefault
classNameA string of all className you want applied to the base component.string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>-

CDropdownToggle#

1import { CDropdownToggle } from '@coreui/react'
2// or
3import CDropdownToggle from '@coreui/react/src/components/dropdown/CDropdownToggle'
PropertyDescriptionTypeDefault
activeToggle the active state for the component.boolean-
caretEnables pseudo element caret on toggler.booleantrue
classNameA string of all className you want applied to the base component.string-
colorSets the color context of the component to one of CoreUI’s themed colors.'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>-
customCreate a custom toggler which accepts any content.boolean-
disabledToggle the disabled state for the component.boolean-
hrefThe href attribute specifies the URL of the page the link goes to.string-
roleThe role attribute describes the role of an element in programs that can make use of it, such as screen readers or magnifiers.string-
shapeSelect the shape of the component.'rounded' | 'rounded-top' | 'rounded-end' | 'rounded-bottom' | 'rounded-start' | 'rounded-circle' | 'rounded-pill' | 'rounded-0' | 'rounded-1' | 'rounded-2' | 'rounded-3' | string-
sizeSize the component small or large.'sm' | 'lg'-
splitSimilarly, create split button dropdowns with virtually the same markup as single button dropdowns, but with the addition of .dropdown-toggle-split className for proper spacing around the dropdown caret.boolean-
triggerSets which event handlers you’d like provided to your toggle prop. You can specify one trigger or an array of them.'hover' | 'focus' | 'click'click
variantSet the button variant to an outlined button or a ghost button.'outline' | 'ghost'-