Dropdown

theme-dropdown   

Copy
Edit
<!-- components/Dropdown/theme-dropdown.html --> <div class="theme-dropdown dropdown"> <button class="base-btn secondary-gray-btn dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> Account <span class="dropdown-icon"><i class="icomoon-chevron-down"></i></span> </button> <div class="dropdown-menu" aria-labelledby="dropdownMenu1"> <a href="#" class="dropdown-head"> <span class="icon-badges icon-badges-md"> <i class="icomoon-user"></i> </span> <div class="dropdown-head-content"> <p class="title">Olivia Rhye</p> <p class="desc">Admin</p> </div> </a> <ul class="list"> <li><a href="#">View profile</a></li> <li><a href="#">Settings</a></li> <li><a href="#">Keyboard shortcuts</a></li> <li role="separator" class="divider"></li> <li><a href="#">Company profile</a></li> <li><a href="#">Team</a></li> <li><a href="#">Invite colleagues</a></li> <li role="separator" class="divider"></li> <li><a href="#">Changelog</a></li> <li><a href="#">Slack Community</a></li> <li><a href="#">Support</a></li> <li><a href="#">API</a></li> <li role="separator" class="divider"></li> <li><a href="#">Log Out</a></li> </ul> </div> </div> <div class="theme-dropdown dropdown mr-2"> <button class="base-btn secondary-gray-btn dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> Dropdown Checkbox <span class="dropdown-icon"><i class="icomoon-chevron-down"></i></span> </button> <div class="dropdown-menu" aria-labelledby="dropdownMenu1"> <a href="#" class="dropdown-head"> <span class="icon-badges icon-badges-md"> <i class="icomoon-user"></i> </span> <div class="dropdown-head-content"> <p class="title">Olivia Rhye</p> <p class="desc">Admin</p> </div> </a> <ul class="list"> <li> <label class="theme-chechbox"> <input type="checkbox"> <span class="checkmark"></span> <div class="checkbox-content"> <p class="title">Chechbox</p> </div> </label> </li> <li> <label class="theme-chechbox"> <input type="checkbox"> <span class="checkmark"></span> <div class="checkbox-content"> <p class="title">Chechbox</p> </div> </label> </li> <li> <label class="theme-chechbox"> <input type="checkbox"> <span class="checkmark"></span> <div class="checkbox-content"> <p class="title">Chechbox</p> </div> </label> </li> <li role="separator" class="divider"></li> <li> <label class="theme-chechbox"> <input type="checkbox"> <span class="checkmark"></span> <div class="checkbox-content"> <p class="title">Chechbox</p> </div> </label> </li> </ul> </div> </div> <div class="theme-dropdown dropdown mr-2"> <button class="base-btn secondary-gray-btn dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> Dropdown List Icon <span class="dropdown-icon"><i class="icomoon-chevron-down"></i></span> </button> <div class="dropdown-menu" aria-labelledby="dropdownMenu1"> <a href="#" class="dropdown-head"> <span class="icon-badges icon-badges-md"> <i class="icomoon-user"></i> </span> <div class="dropdown-head-content"> <p class="title">Olivia Rhye</p> <p class="desc">Admin</p> </div> </a> <ul class="list"> <li><a href="#"><i class="icomoon-user"></i>View profile</a></li> <li><a href="#"><i class="icomoon-dollar-sign"></i>Billing Account</a></li> <li><a href="#"><i class="icomoon-globe"></i>[LANGUAGE SWITCH]</a></li> <li role="separator" class="divider"></li> <li><a href="#"><i class="icomoon-log-out"></i>Log Out</a></li> </ul> </div> </div> <div class="theme-dropdown theme-dropdown-active dropdown mr-2"> <button class="base-btn secondary-gray-btn dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> Dropdown Set Active <span class="dropdown-icon"><i class="icomoon-chevron-down"></i></span> </button> <div class="dropdown-menu" aria-labelledby="dropdownMenu1"> <ul class="list"> <li class="active"><a href="#">Price</a></li> <li><a href="#">Payment</a></li> <li><a href="#">Orders</a></li> <li><a href="#">Shipping</a></li> <li><a href="#">Taxes</a></li> <li><a href="#">Profile</a></li> <li><a href="#">Language</a></li> <li><a href="#">Phoenix Baker</a></li> <li><a href="#">Payment</a></li> <li><a href="#">Orders</a></li> </ul> </div> </div> <div class="theme-dropdown dropdown mr-2"> <button class="base-btn secondary-gray-btn dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> Dropdown title and footer <span class="dropdown-icon"><i class="icomoon-chevron-down"></i></span> </button> <div class="dropdown-menu" aria-labelledby="dropdownMenu1"> <p class="title"> Account menu </p> <ul class="list"> <li><a href="#">Price</a></li> <li><a href="#">Payment</a></li> <li><a href="#">Orders</a></li> <li><a href="#">Shipping</a></li> <li><a href="#">Taxes</a></li> <li class="foot"><a href="#">Orders</a></li> </ul> </div> </div> <div class="theme-dropdown dropdown mr-2"> <button class="dropdown-btn-icon dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <span class="icon-badges icon-badges-md"> <i class="icomoon-user"></i> </span> </button> <div class="dropdown-menu" aria-labelledby="dropdownMenu1"> <a href="#" class="dropdown-head"> <span class="icon-badges icon-badges-md"> <i class="icomoon-user"></i> </span> <div class="dropdown-head-content"> <p class="title">Olivia Rhye</p> <p class="desc">Admin</p> </div> </a> <ul class="list"> <li><a href="#"><i class="icomoon-user"></i>View profile</a></li> <li><a href="#"><i class="icomoon-dollar-sign"></i>Billing Account</a></li> <li><a href="#"><i class="icomoon-globe"></i>[LANGUAGE SWITCH]</a></li> <li role="separator" class="divider"></li> <li><a href="#"><i class="icomoon-log-out"></i>Log Out</a></li> </ul> </div> </div>
Copy
Copy
Edit
/* scss/Dropdown/_theme-dropdown.scss */ .theme-dropdown { display: inline-block; &.dropdown-right { .dropdown-menu { @include dir-right(0); @include dir-left(auto); } } .dropdown-icon { margin-inline-start: 10px; transition: 0.3s ease; } .dropdown-menu { max-width: 240px; width: 240px; border: 1px solid $gray-200; box-sizing: border-box; box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.1), 0px 4px 6px -2px rgba(16, 24, 40, 0.05); border-radius: 8px; top: calc(100% + 5px); padding: 0; overflow: hidden; @include dir-left(0); @include dir-right(auto); .dropdown-head { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid $gray-100; transition: 0.3s ease; .icon-badges i { margin: 0; } .dropdown-head-content { margin-inline-start: 12px; .title { color: $gray-700; margin: 0; @extend .weight-m; } .desc { color: $gray-500; margin: 0; } } &:hover, &:focus { background-color: $primary-25; } } > .title { padding: 12px 16px; border-bottom: 1px solid $gray-100; @extend .text-md; @extend .weight-m; } ul.list { max-height: 300px; overflow: auto; &::-webkit-scrollbar-track { border-radius: 10px; } &::-webkit-scrollbar { background-color: transparent; height: 10px; width: 8px; } &::-webkit-scrollbar-thumb { background-color: $gray-200; border-radius: 50px; } i { font-size: 16px; } .foot a { border-top: 1px solid $gray-100; } } .divider { height: 1px; margin: 0; overflow: hidden; background-color: $gray-100; } li a, li label { padding: 10px 14px; display: flex; align-items: center; white-space: normal; color: $gray-700; transition: 0.3s ease; i { margin-inline-end: 10px; } &:hover, &:focus { background-color: $primary-25; } } } &.open { .dropdown-icon { transform: rotate(180deg); } } // dropdown with icon .dropdown-btn-icon { background: transparent; outline: none; border: none; border-radius: 50%; padding: 0; .icon-badges { background-color: $primary-50; } &:focus { box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px #E3EBFC; } img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; } .user-letter { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background-color: $primary-50; color: $primary-700; @extend .display-xs } } // dropdown set active &.theme-dropdown-active { ul.list { li.active a { color: $primary-700; background-color: $primary-50; &::after { content: "\e97d"; font-family: 'icomoonapp' !important; margin-inline-start: auto; } html[dir="rtl"] & { right: auto; left: -21px; } } } } }