Dropdowns
Vue Bootstrap 5 Dropdown component
Toggle contextual overlays for displaying lists of links and more with the MDB dropdown plugin.
Note: Read the API tab to find all available options and advanced customization
Basic examples
Wrap the MDBDropdownToggle
(your button or link) and the
MDBDropdownMenu
within MDBDropdown
element. Bind any
truthy
or falsy
ref value to MDBDropdownMenu
and toggle
dropdown with a MDBDropdownToggle
component. MDBDropdownMenu
use
semantic <ul>
elements where appropriate, but custom markup is supported.
Colors
You can do this with any button variant:
<template>
<!-- Primary -->
<MDBDropdown btnGroup v-model="dropdown3">
<MDBDropdownToggle @click="dropdown3 = !dropdown3">
Action
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Secondary -->
<MDBDropdown btnGroup v-model="dropdown4">
<MDBDropdownToggle
@click="dropdown4 = !dropdown4"
color="secondary"
>
Action
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Success -->
<MDBDropdown btnGroup v-model="dropdown5">
<MDBDropdownToggle
@click="dropdown5 = !dropdown5"
color="success"
>
Action
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Info -->
<MDBDropdown btnGroup v-model="dropdown6">
<MDBDropdownToggle @click="dropdown6 = !dropdown6" color="info">
Action
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Warning -->
<MDBDropdown btnGroup v-model="dropdown7">
<MDBDropdownToggle
@click="dropdown7 = !dropdown7"
color="warning"
>
Action
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Danger -->
<MDBDropdown btnGroup v-model="dropdown8">
<MDBDropdownToggle @click="dropdown8 = !dropdown8" color="danger">
Action
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Dark -->
<MDBDropdown btnGroup v-model="dropdown9">
<MDBDropdownToggle @click="dropdown9 = !dropdown9" color="dark">
Action
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Light -->
<MDBDropdown btnGroup v-model="dropdown10">
<MDBDropdownToggle
@click="dropdown10 = !dropdown10"
color="light"
>
Action
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Link -->
<MDBDropdown btnGroup v-model="dropdown11">
<MDBDropdownToggle @click="dropdown11 = !dropdown11" color="link">
Action
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
</template>
<script>
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem } from "mdb-vue-ui-kit";
import { ref } from 'vue';
export default {
components: {
MDBDropdown,
MDBDropdownToggle,
MDBDropdownMenu,
MDBDropdownItem
},
setup() {
const dropdown3 = ref(false);
const dropdown4 = ref(false);
const dropdown5 = ref(false);
const dropdown6 = ref(false);
const dropdown7 = ref(false);
const dropdown8 = ref(false);
const dropdown9 = ref(false);
const dropdown10 = ref(false);
const dropdown11 = ref(false);
const dropdown12 = ref(false);
return {
dropdown3,
dropdown4,
dropdown5,
dropdown6,
dropdown7,
dropdown8,
dropdown9,
dropdown10,
dropdown11,
dropdown12
}
}
};
</script>
<script setup lang="ts">
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem } from "mdb-vue-ui-kit";
import { ref } from 'vue';
const dropdown3 = ref(false);
const dropdown4 = ref(false);
const dropdown5 = ref(false);
const dropdown6 = ref(false);
const dropdown7 = ref(false);
const dropdown8 = ref(false);
const dropdown9 = ref(false);
const dropdown10 = ref(false);
const dropdown11 = ref(false);
const dropdown12 = ref(false);
</script>
Sizing
MDBDropdownToggle
work with all button sizes, including default and split
dropdown buttons.
<template>
<div>
<!-- Large button groups (default and split) -->
<MDBDropdown btnGroup v-model="dropdown13">
<MDBDropdownToggle size="lg" @click="dropdown13 = !dropdown13">
Large button
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<MDBDropdown btnGroup v-model="dropdown14">
<MDBBtn color="primary">Large split button</MDBBtn>
<MDBDropdownToggle
split
size="lg"
@click="dropdown14 = !dropdown14"
/>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Small button groups (default and split) -->
<MDBDropdown btnGroup v-model="dropdown15">
<MDBDropdownToggle size="sm" @click="dropdown15 = !dropdown15">
Small button
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<MDBDropdown btnGroup v-model="dropdown16">
<MDBBtn color="primary" size="sm">Small split button</MDBBtn>
<MDBDropdownToggle
split
size="sm"
@click="dropdown16 = !dropdown16"
/>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
</div>
</template>
<script>
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem, MDBBtn } from "mdb-vue-ui-kit";
import { ref } from 'vue';
export default {
components: {
MDBDropdown,
MDBDropdownToggle,
MDBDropdownMenu,
MDBDropdownItem,
MDBBtn
},
setup() {
const dropdown13 = ref(false);
const dropdown14 = ref(false);
const dropdown15 = ref(false);
const dropdown16 = ref(false);
return {
dropdown13,
dropdown14,
dropdown15,
dropdown16
}
}
};
</script>
<script setup lang="ts">
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem, MDBBtn } from "mdb-vue-ui-kit";
import { ref } from 'vue';
const dropdown13 = ref(false);
const dropdown14 = ref(false);
const dropdown15 = ref(false);
const dropdown16 = ref(false);
</script>
Directions
Dropup
Trigger dropdown menus above elements by adding
dropup
property to the MDBDropdown
component.
<template>
<!-- Default dropup button -->
<MDBDropdown btnGroup dropup v-model="dropdown17">
<MDBDropdownToggle @click="dropdown17 = !dropdown17">
Dropup
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Split dropup button -->
<MDBDropdown btnGroup dropup v-model="dropdown18">
<MDBBtn color="primary">Split dropup</MDBBtn>
<MDBDropdownToggle split @click="dropdown18 = !dropdown18" />
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
</template>
<script>
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem, MDBBtn } from "mdb-vue-ui-kit";
import { ref } from 'vue';
export default {
components: {
MDBDropdown,
MDBDropdownToggle,
MDBDropdownMenu,
MDBDropdownItem,
MDBBtn
},
setup() {
const dropdown17 = ref(false);
const dropdown18 = ref(false);
return {
dropdown17,
dropdown18
}
}
};
</script>
<script setup lang="ts">
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem, MDBBtn } from "mdb-vue-ui-kit";
import { ref } from 'vue';
const dropdown17 = ref(false);
const dropdown18 = ref(false);
</script>
Dropright
Trigger dropdown menus at the right of the elements by adding
.dropend
to the parent element.
<template>
<!-- Default dropend button -->
<MDBDropdown btnGroup dropend v-model="dropdown19">
<MDBDropdownToggle @click="dropdown19 = !dropdown19">
Dropend
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Split dropend button -->
<MDBDropdown btnGroup dropend v-model="dropdown20">
<MDBBtn color="primary">Split dropend</MDBBtn>
<MDBDropdownToggle split @click="dropdown20 = !dropdown20" />
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
</template>
<script>
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem, MDBBtn } from "mdb-vue-ui-kit";
import { ref } from 'vue';
export default {
components: {
MDBDropdown,
MDBDropdownToggle,
MDBDropdownMenu,
MDBDropdownItem,
MDBBtn
},
setup() {
const dropdown19 = ref(false);
const dropdown20 = ref(false);
return {
dropdown19,
dropdown20
}
}
};
</script>
<script setup lang="ts">
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem, MDBBtn } from "mdb-vue-ui-kit";
import { ref } from 'vue';
const dropdown19 = ref(false);
const dropdown20 = ref(false);
</script>
Dropleft
Trigger dropdown menus at the left of the elements by adding
dropstart
property to the MDBDropdown
component.
<template>
<!-- Default dropstart button -->
<MDBDropdown btnGroup dropstart v-model="dropdown21">
<MDBDropdownToggle @click="dropdown21 = !dropdown21">
Dropstart
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<!-- Split dropstart button -->
<div class="btn-group">
<MDBDropdown btnGroup dropstart v-model="dropdown22">
<MDBDropdownToggle split @click="dropdown22 = !dropdown22" />
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<MDBBtn color="primary">Split dropstart</MDBBtn>
</div>
</template>
<script>
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem, MDBBtn } from "mdb-vue-ui-kit";
import { ref } from 'vue';
export default {
components: {
MDBDropdown,
MDBDropdownToggle,
MDBDropdownMenu,
MDBDropdownItem,
MDBBtn
},
setup() {
const dropdown21 = ref(false);
const dropdown22 = ref(false);
return {
dropdown21,
dropdown22
}
}
};
</script>
<script setup lang="ts">
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem, MDBBtn } from "mdb-vue-ui-kit";
import { ref } from 'vue';
const dropdown21 = ref(false);
const dropdown22 = ref(false);
</script>
Remove animation
To remove the fade animation on click, add
:animation="false"
attribute to the MDBDRopdownToggle
.
<template>
<MDBDropdown v-model="dropdown28">
<MDBDropdownToggle
@click="dropdown28 = !dropdown28"
id="dropdownExampleAnimation"
>
Dropdown button
</MDBDropdownToggle>
<MDBDropdownMenu :animation="false">
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
</template>
<script>
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem } from "mdb-vue-ui-kit";
import { ref } from 'vue';
export default {
components: {
MDBDropdown,
MDBDropdownToggle,
MDBDropdownMenu,
MDBDropdownItem
},
setup() {
const dropdown28 = ref(false);
return {
dropdown28
}
}
};
</script>
<script setup lang="ts">
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem } from "mdb-vue-ui-kit";
import { ref } from 'vue';
const dropdown28 = ref(false);
</script>
Dropdown options
To change the offset of the dropdown menu add
offset="skiddingValue, distanceValue"
property. To change the location of the
dropdown menu add target
property with value of selector to expected reference
for dropdown.
<template>
<div class="d-flex">
<MDBDropdown offset="10,20" class="me-1" v-model="dropdown29">
<MDBDropdownToggle @click="dropdown29 = !dropdown29">
Offset
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated list</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
<MDBDropdown
btnGroup
id="referenceTarget"
target="#referenceTarget"
v-model="dropdown30"
>
<MDBBtn color="primary">Reference</MDBBtn>
<MDBDropdownToggle split @click="dropdown30 = !dropdown30">
<span class="visually-hidden">Toggle Dropdown</span>
</MDBDropdownToggle>
<MDBDropdownMenu>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated list</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
</div>
</template>
<script>
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem } from "mdb-vue-ui-kit";
import { ref } from 'vue';
export default {
components: {
MDBDropdown,
MDBDropdownToggle,
MDBDropdownMenu,
MDBDropdownItem
},
setup() {
const dropdown29 = ref(false);
const dropdown30 = ref(false);
return {
dropdown29,
dropdown30,
}
}
};
</script>
<script setup lang="ts">
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem } from "mdb-vue-ui-kit";
import { ref } from 'vue';
const dropdown29 = ref(false);
const dropdown30 = ref(false);
</script>
Dark variant
Add dark
property onto an existing MDBDropdownMenu
to match a dark
navbar.
<template>
<MDBDropdown v-model="dropdown31">
<MDBDropdownToggle
@click="dropdown31 = !dropdown31"
id="dropdownExampleAnimation"
>
Dropdown button
</MDBDropdownToggle>
<MDBDropdownMenu dark>
<MDBDropdownItem href="#">Action</MDBDropdownItem>
<MDBDropdownItem href="#">Another Action</MDBDropdownItem>
<MDBDropdownItem href="#">Something else here</MDBDropdownItem>
<MDBDropdownItem divider />
<MDBDropdownItem href="#">Separated link</MDBDropdownItem>
</MDBDropdownMenu>
</MDBDropdown>
</template>
<script>
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem } from "mdb-vue-ui-kit";
import { ref } from 'vue';
export default {
components: {
MDBDropdown,
MDBDropdownToggle,
MDBDropdownMenu,
MDBDropdownItem
},
setup() {
const dropdown31 = ref(false);
return {
dropdown31
}
}
};
</script>
<script setup lang="ts">
import { MDBDropdown, MDBDropdownToggle, MDBDropdownMenu, MDBDropdownItem } from "mdb-vue-ui-kit";
import { ref } from 'vue';
const dropdown31 = ref(false);
</script>
Dropdowns - API
Import
<script>
import {
MDBDropdown,
MDBDropdownToggle,
MDBDropdownMenu,
MDBDropdownItem
} from 'mdb-vue-ui-kit';
</script>
Properties
MDBDropdown
Name | Type | Default | Description | Example |
---|---|---|---|---|
tag
|
String | 'div' |
Defines tag of the MDBDropdown element |
<MDBDropdown tag="section" />
|
v-model
|
Boolean |
|
Toggle MDBDropdown component open and closed |
<MDBDropdown tag="true" />
|
btnGroup
|
Boolean | false |
Changes alignment of the toggler to fit within a button gro |
<MDBDropdown btnGroup />
|
dropup
|
Boolean | false |
Trigger dropdown menus above elements |
<MDBDropdown dropup />
|
dropend
|
Boolean | false |
Trigger dropdown menus at the right of the elements |
<MDBDropdown dropend />
|
dropstart
|
Boolean | false |
Trigger dropdown menus at the left of the elements |
<MDBDropdown dropstart />
|
align
|
String | Array | 'start' |
Aligns dropdown menu along the left or rigth side of the parent |
<MDBDropdown align="end" />
|
offset |
String |
|
Offset of the dropdown menu relative to its parent. |
<MDBDropdown offset="0, 10" />
|
target |
String |
|
Sets custom selector for dropdown menu reference target |
<MDBPopover target="#reference-target" />
|
MDBDropdownToggle
Name | Type | Default | Description | Example |
---|---|---|---|---|
tag
|
String | 'button' |
Defines tag of the MDBDropdownToggle element |
<MDBDropdownToggle tag="div" />
|
color
|
String | 'primary |
Sets color of the MDBDropdownToggle element |
<MDBDropdownToggle color="secondary" />
|
href
|
String |
|
Sets href attribute if tag is set to a |
<MDBDropdownToggle tag="a" href="#" />
|
split
|
Boolean | false |
Allows to create split buttons |
<MDBBtn color="primary">Split</MDBBtn>
<MDBDropdownToggle split />
|
MDBDropdownItem
Name | Type | Default | Description | Example |
---|---|---|---|---|
tag
|
String | 'a' |
Defines tag of the MDBDropdownItem element |
<MDBDropdownItem tag="div" />
|
to
|
String | Object |
|
Changes the component's tag to router-link |
<MDBDropdownItem to="/" />
|
href
|
String |
|
The href attribute's value of the anchor tag |
<MDBDropdownItem href="/" />
|
disabled
|
Boolean | false |
Disables the item |
<MDBDropdownItem disabled />
|
active
|
Boolean | false |
Adds active class to the item |
<MDBDropdownItem active />
|
exact
|
Boolean | false |
Sets exact attribute of the component |
<MDBDropdownItem to="/" exact />
|
newTab
|
Boolean | false |
Sets component's target to "_blank" |
<MDBDropdownItem href="/" newTab />
|
divider
|
Boolean | false |
Sets element as a divider |
<MDBDropdownItem divider />
|
text
|
Boolean | false |
Sets element as a text element |
<MDBDropdownItem text />
|
header
|
Boolean | false |
Sets element as a header element |
<MDBDropdownItem header ag="h6" />
|
CSS variables
As part of MDB’s evolving CSS variables approach, dropdown now uses local CSS variables on
.dropdown-menu
, .dropdown-item
and .dropdown-divider
for enhanced real-time customization. Values for the CSS variables
are set via Sass, so Sass customization is still supported, too.
// .dropdown-menu
--#{$prefix}dropdown-zindex: #{$zindex-dropdown};
--#{$prefix}dropdown-min-width: #{$dropdown-min-width};
--#{$prefix}dropdown-padding-x: #{$dropdown-padding-x};
--#{$prefix}dropdown-padding-y: #{$dropdown-padding-y};
--#{$prefix}dropdown-spacer: #{$dropdown-spacer};
--#{$prefix}dropdown-color: #{$dropdown-color};
--#{$prefix}dropdown-bg: #{$dropdown-bg};
--#{$prefix}dropdown-border-color: #{$dropdown-border-color};
--#{$prefix}dropdown-border-radius: #{$dropdown-border-radius};
--#{$prefix}dropdown-border-width: #{$dropdown-border-width};
--#{$prefix}dropdown-inner-border-radius: #{$dropdown-inner-border-radius};
--#{$prefix}dropdown-divider-bg: #{$dropdown-divider-bg};
--#{$prefix}dropdown-divider-margin-y: #{$dropdown-divider-margin-y};
--#{$prefix}dropdown-box-shadow: #{$dropdown-box-shadow};
--#{$prefix}dropdown-link-color: #{$dropdown-link-color};
--#{$prefix}dropdown-link-hover-color: #{$dropdown-link-hover-color};
--#{$prefix}dropdown-link-hover-bg: #{$dropdown-link-hover-bg};
--#{$prefix}dropdown-link-active-color: #{$dropdown-link-active-color};
--#{$prefix}dropdown-link-active-bg: #{$dropdown-link-active-bg};
--#{$prefix}dropdown-link-disabled-color: #{$dropdown-link-disabled-color};
--#{$prefix}dropdown-item-padding-x: #{$dropdown-item-padding-x};
--#{$prefix}dropdown-item-padding-y: #{$dropdown-item-padding-y};
--#{$prefix}dropdown-header-color: #{$dropdown-header-color};
--#{$prefix}dropdown-header-padding-x: #{$dropdown-header-padding-x};
--#{$prefix}dropdown-header-padding-y: #{$dropdown-header-padding-y};
--#{$prefix}dropdown-item-border-radius: #{$dropdown-item-border-radius};
--#{$prefix}dropdown-menu-animated-animation-duration: #{$dropdown-menu-animated-animation-duration};
--#{$prefix}dropdown-menu-animated-animation-timing-function: #{$dropdown-menu-animated-animation-timing-function};
// .dropdown-item
--#{$prefix}dropdown-state-color: #{$dropdown-state-color};
--#{$prefix}dropdown-state-background-color: #{$dropdown-state-background-color};
// .dropdown-divider
--#{$prefix}dropdown-divider-border-top-width: #{$dropdown-divider-border-top-width};
--#{$prefix}dropdown-divider-border-top-bg: #{$dropdown-divider-bg};
// .dropdown-menu-dark
--#{$prefix}dropdown-color: #{$dropdown-dark-color};
--#{$prefix}dropdown-bg: #{$dropdown-dark-bg};
--#{$prefix}dropdown-border-color: #{$dropdown-dark-border-color};
--#{$prefix}dropdown-box-shadow: #{$dropdown-dark-box-shadow};
--#{$prefix}dropdown-link-color: #{$dropdown-dark-link-color};
--#{$prefix}dropdown-link-hover-color: #{$dropdown-dark-link-hover-color};
--#{$prefix}dropdown-divider-bg: #{$dropdown-dark-divider-bg};
--#{$prefix}dropdown-link-hover-bg: #{$dropdown-dark-link-hover-bg};
--#{$prefix}dropdown-link-active-color: #{$dropdown-dark-link-active-color};
--#{$prefix}dropdown-link-active-bg: #{$dropdown-dark-link-active-bg};
--#{$prefix}dropdown-link-disabled-color: #{$dropdown-dark-link-disabled-color};
--#{$prefix}dropdown-header-color: #{$dropdown-dark-header-color};
SCSS variables
$zindex-dropdown: 1000;
$dropdown-color: $body-color;
$dropdown-padding-x: 0;
$dropdown-padding-y: 0.5rem;
$dropdown-margin-top: 0.125rem;
$dropdown-box-shadow: $box-shadow-4;
$dropdown-font-size: 0.875rem;
$dropdown-item-border-radius: 0.5rem;
$dropdown-item-padding-y: 0.5rem;
$dropdown-item-padding-x: 1rem;
$dropdown-border-radius: 0.5rem;
$dropdown-divider-bg: hsl(0, 0%, 96%);
$dropdown-divider-border-top-width: 2px;
$dropdown-divider-margin-y: $spacer * 0.5;
$dropdown-state-color: #16181b;
$dropdown-state-background-color: #eee;
$dropdown-menu-animated-animation-duration: 0.55s;
$dropdown-menu-animated-animation-timing-function: ease;
$dropdown-animation-duration: 1s;
$dropdown-min-width: 10rem;
$dropdown-spacer: 0.125rem;
$dropdown-color: $body-color;
$dropdown-bg: $white;
$dropdown-border-color: var(--#{$prefix}border-color-translucent);
$dropdown-border-width: $border-width;
$dropdown-inner-border-radius: subtract($dropdown-border-radius, $dropdown-border-width);
$dropdown-link-color: $gray-900;
$dropdown-link-hover-color: shade-color($dropdown-link-color, 10%);
$dropdown-link-hover-bg: $gray-200;
$dropdown-link-active-color: $component-active-color;
$dropdown-link-active-bg: $component-active-bg;
$dropdown-link-disabled-color: $gray-500;
$dropdown-header-color: $gray-600;
$dropdown-header-padding-x: $dropdown-item-padding-x;
$dropdown-header-padding-y: $dropdown-padding-y;
$dropdown-header-padding: $dropdown-header-padding-y $dropdown-header-padding-x;
// dark
$dropdown-dark-color: $gray-300;
$dropdown-dark-bg: $gray-800;
$dropdown-dark-border-color: $dropdown-border-color;
$dropdown-dark-divider-bg: $dropdown-divider-bg;
$dropdown-dark-box-shadow: null;
$dropdown-dark-link-color: $dropdown-dark-color;
$dropdown-dark-link-hover-color: $white;
$dropdown-dark-link-hover-bg: rgba($white, 0.15);
$dropdown-dark-link-active-color: $dropdown-link-active-color;
$dropdown-dark-link-active-bg: $dropdown-link-active-bg;
$dropdown-dark-link-disabled-color: $gray-500;
$dropdown-dark-header-color: $gray-500;