-
Notifications
You must be signed in to change notification settings - Fork 4
Dropdown
지훈 edited this page Jun 1, 2025
·
3 revisions
드롭다운 공통 컴포넌트입니다.
interface DropdownProps {
label: string;
options: string[];
onSelect: (value: string) => void;
}- 비교적 간단한 props 전달로 사용할 수 있습니다.
-
label과 배열 타입의options(넘겨줄 list들의 값),onSelect(list에서label값으로 바꾸기 위한 함수)를 활용해주세요.

const handleSelect = (value: string) => {
console.log('선택된 값:', value);
};
return (
<div style={{ padding: '20px' }}>
<Dropdown label="가격" options={['₩10,000', '₩20,000', '₩30,000']} onSelect={handleSelect} />
</div>
);
};
/>