다른 컴포넌트 보기

COMPONENT / 탐색

SegmentedControl

짧은 선택지를 나란히 배치.

LIVE PREVIEWWEB
PLAYGROUND

사용 코드

import { useState } from 'react';
import * as W from 'woosign-system';

// ThemeProvider와 ToastProvider 안에서 렌더링하세요.
export function Example() {
  const [value, setValue] = useState('paper');
  const options = [
    { value: 'paper', label: 'Paper' },
    { value: 'ink', label: 'Ink' },
    { value: 'ember', label: 'Ember' },
  ];
  return (
    <W.SegmentedControl
      label="팔레트 선택"
      items={options}
      value={value}
      onValueChange={setValue}
      disabled={false}
    />
  );
}
PropType필수
itemsreadonly {value: string; label: string; disabled?: boolean}[]●
valuestring—
defaultValuestring—
onValueChange(value: string) => void—
disabledboolean—
labelstring●

공통 API 기준입니다. 플랫폼별 style, className 및 세부 타입은 타입 정의에서 확인하세요.

← 전체 컴포넌트로 돌아가기