Custom Theme
No default styles imported. Every visual element is styled via custom class names, producing a frost theme with an indigo accent. This demonstrates the full styling control the library provides.
No selection
The CSS
The full stylesheet used in the demo above. It uses a cool indigo palette with glassmorphism effects and targets every customizable element.
frost-theme.css
.frost-container {
position: relative;
width: 320px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
gap: 8px;
}
.frost-input {
width: 100%;
height: 40px;
padding: 0 12px;
border: 1px solid rgba(139, 162, 255, 0.2);
border-radius: 10px;
font-size: 14px;
color: rgba(255, 255, 255, 0.9);
background: rgba(15, 18, 35, 0.9);
backdrop-filter: blur(12px);
outline: none;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.frost-input:focus {
border-color: rgba(139, 162, 255, 0.5);
box-shadow: 0 0 0 3px rgba(99, 122, 255, 0.12);
}
.frost-input::placeholder {
color: rgba(160, 170, 210, 0.5);
}
.frost-options {
background: rgba(15, 18, 35, 0.95);
backdrop-filter: blur(16px);
border-radius: 10px;
border: 1px solid rgba(139, 162, 255, 0.15);
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.4),
0 0 0 1px rgba(139, 162, 255, 0.05) inset;
padding: 4px;
}
.frost-option {
padding: 8px 10px;
cursor: pointer;
color: rgba(255, 255, 255, 0.75);
border-radius: 6px;
font-size: 14px;
transition: background-color 0.12s ease, color 0.12s ease;
}
.frost-option-focused {
background-color: rgba(99, 122, 255, 0.12);
color: rgba(255, 255, 255, 0.95);
}
.frost-option-selected {
background-color: rgba(99, 122, 255, 0.18);
}
.frost-option-label {
font-size: 14px;
font-weight: 400;
line-height: 1.5;
}
.frost-option-label-focused {
font-weight: 500;
}
.frost-option-no-match {
padding: 24px 10px;
color: rgba(160, 170, 210, 0.5);
font-size: 14px;
text-align: center;
}
.frost-icon {
position: absolute;
right: 12px;
width: 20px;
height: 20px;
z-index: 1;
color: rgba(139, 162, 255, 0.4);
pointer-events: none;
transition: transform 0.2s ease, color 0.2s ease;
}
.frost-icon-invert {
transform: rotate(180deg);
color: rgba(139, 162, 255, 0.8);
}The component
Wire up the classes via the className props and pass a custom icon that uses
currentColor. No default stylesheets are imported.
FrostExample.tsx
import { SearchableDropdown } from "@luciodale/react-searchable-dropdown";
import "./frost-theme.css";
function ChevronIcon({ toggled }: { toggled: boolean }) {
return (
<svg
viewBox="0 0 24 24"
fill="none"
className={`frost-icon ${toggled ? "" : "frost-icon-invert"}`}
>
<title>Toggle</title>
<path
d="M8 14L12 10L16 14"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
}
<SearchableDropdown
options={options}
value={value}
setValue={setValue}
placeholder="Select framework..."
DropdownIcon={ChevronIcon}
classNameSearchableDropdownContainer="frost-container"
classNameSearchQueryInput="frost-input"
classNameDropdownOptions="frost-options"
classNameDropdownOption="frost-option"
classNameDropdownOptionFocused="frost-option-focused"
classNameDropdownOptionSelected="frost-option-selected"
classNameDropdownOptionLabel="frost-option-label"
classNameDropdownOptionLabelFocused="frost-option-label-focused"
classNameDropdownOptionNoMatch="frost-option-no-match"
/>