| name | dropdown |
| description | Generate dropdown menus with glass styling, keyboard navigation, and animated open/close. |
Dropdown Component
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-trigger {
padding: 10px 16px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 10px;
color: rgba(255, 255, 255, 0.8);
font-size: 13px;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: all 0.15s ease;
}
.dropdown-trigger:hover {
background: rgba(255, 255, 255, 0.06);
border-color: rgba(255, 255, 255, 0.12);
}
.dropdown-menu {
position: absolute;
top: calc(100% + 6px);
left: 0;
min-width: 200px;
padding: 6px;
background: rgba(16, 18, 30, 0.95);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 12px;
backdrop-filter: blur(20px);
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
opacity: 0;
transform: translateY(-4px) scale(0.98);
pointer-events: none;
transition: all 0.15s ease;
z-index: 1000;
}
.dropdown.open .dropdown-menu {
opacity: 1;
transform: translateY(0) scale(1);
pointer-events: auto;
}
.dropdown-item {
padding: 8px 12px;
border-radius: 8px;
color: rgba(255, 255, 255, 0.7);
font-size: 13px;
cursor: pointer;
transition: all 0.1s ease;
}
.dropdown-item:hover {
background: rgba(255, 255, 255, 0.06);
color: rgba(255, 255, 255, 0.95);
}
.dropdown-divider {
height: 1px;
background: rgba(255, 255, 255, 0.06);
margin: 4px 0;
}
Rules:
- Close on Escape or click outside
- Arrow keys navigate items
- Auto-position to stay within viewport