다른 컴포넌트 보기
COMPONENT / 폼과 입력
Combobox
검색으로 빠르게 찾는 선택지.
PLAYGROUND
사용 코드
import { useId, useState } from 'react';
import * as W from 'woosign-system';
// ThemeProvider와 ToastProvider 안에서 렌더링하세요.
export function Example() {
const id = useId();
const [value, setValue] = useState('paper');
const options = [
{ value: 'paper', label: 'Paper' },
{ value: 'ink', label: 'Ink' },
{ value: 'ember', label: 'Ember' },
];
return (
<W.Combobox
id={id}
label="팔레트 검색"
options={options}
value={value}
onValueChange={setValue}
disabled={false}
/>
);
}
API
타입 정의 ↗| Prop | Type | 필수 |
|---|---|---|
id | string | ● |
options | readonly {value: string; label: string; disabled?: boolean}[] | ● |
value | string | — |
defaultValue | string | — |
onValueChange | (value: string) => void | — |
label | string | ● |
placeholder | string | — |
searchPlaceholder | string | — |
emptyMessage | string | — |
disabled | boolean | — |
error | boolean | — |
name | string | — |
공통 API 기준입니다. 플랫폼별 style, className 및 세부 타입은 타입 정의에서 확인하세요.
← 전체 컴포넌트로 돌아가기