Lynx

Select Box

명확한 테두리를 가진 컨테이너를 활용하여, 정의된 목록 중 하나 이상의 옵션을 선택하는 UI 요소입니다.

Engine ≥ 3.6
사용 가능 버전@seed-design/lynx-react@0.6.0, @seed-design/lynx-css@0.10.0
Lynx 예제를 불러오는 중입니다.

문서 미리보기에서는 아이콘 색상이 적용되지 않아요. 아이콘의 실제 색상은 QR 코드 탭에서 Lynx Explorer를 실행해 확인할 수 있어요.

Installation

npx @seed-design/cli@latest add ui:select-box

Props

Check Select Box

CheckSelectBoxGroup

Prop

Type

style?CSSProperties | undefined
children?React.ReactNode
className?string | undefined

CheckSelectBox

Prop

Type

labelReact.ReactNode
description?React.ReactNode
prefixIcon?React.ReactElement<LynxIconElementProps, string | React.JSXElementConstructor<any>> | undefined
suffix?React.ReactNode
className?string | undefined
checked?boolean | undefined
defaultChecked?boolean | undefined
indeterminate?boolean | undefined
onCheckedChange?((checked: boolean) => void) | undefined
style?CSSProperties | undefined

CheckSelectBoxCheckmark

Prop

Type

style?CSSProperties | undefined
children?React.ReactNode
className?string | undefined

Radio Select Box

RadioSelectBoxRoot

Prop

Type

value?string | undefined
defaultValue?string | undefined
onValueChange?((value: string) => void) | undefined
style?CSSProperties | undefined
children?React.ReactNode
className?string | undefined

RadioSelectBoxItem

Prop

Type

labelReact.ReactNode
description?React.ReactNode
prefixIcon?React.ReactElement<LynxIconElementProps, string | React.JSXElementConstructor<any>> | undefined
suffix?React.ReactNode
className?string | undefined
disabled?boolean | undefined
style?CSSProperties | undefined
valuestring

RadioSelectBoxRadiomark

Prop

Type

style?CSSProperties | undefined
children?React.ReactNode
className?string | undefined

Examples

Customizing Label

label prop에 여러 요소를 조합한 사용자 정의 콘텐츠를 전달할 수 있습니다.

Lynx 예제를 불러오는 중입니다.

Listening to Value Changes

CheckSelectBoxonCheckedChange를 사용하여 체크박스의 선택 상태 변경을 감지할 수 있습니다.

RadioSelectBoxRootonValueChange를 사용하여 라디오 버튼의 선택 값 변경을 감지할 수 있습니다.

Lynx 예제를 불러오는 중입니다.

Grid Layout (Columns)

columns prop을 사용하여 여러 열로 배치할 수 있습니다. columns가 1보다 크면 하위 요소의 layout이 자동으로 "vertical"로 설정됩니다.

필요한 경우 layout prop을 직접 설정하여 개별 항목의 레이아웃을 오버라이드할 수 있습니다.

Lynx 예제를 불러오는 중입니다.

With Suffix

suffix prop을 사용하여 체크마크, 라디오 마크, 또는 커스텀 요소를 표시할 수 있습니다. CheckSelectBoxCheckmarkRadioSelectBoxRadiomark를 사용하거나, 아이콘이나 텍스트 등 자유로운 요소를 전달할 수 있습니다.

Lynx 예제를 불러오는 중입니다.

footer prop으로 추가 콘텐츠를 표시할 수 있습니다. footerVisibility prop으로 footer의 표시 조건을 제어할 수 있습니다.

  • "when-selected" (기본값): 항목이 선택되었을 때만 표시
  • "when-not-selected": 항목이 선택되지 않았을 때만 표시
  • "always": 항상 표시
Lynx 예제를 불러오는 중입니다.

웹 버전과의 차이

Lynx Select Box는 React 버전과 다음 차이가 있습니다.

  • React Hook Form 미지원: Lynx에는 native form 제출 모델이 없어 React Hook Form 예제를 제공하지 않습니다.
  • Field wrapper 없음: React Registry의 Fieldset과 RadioGroupField 연동, field label, description, error message 연결을 제공하지 않습니다.
  • form 제출 없음: Hidden input과 inputProps, name, required, invalid를 제공하지 않습니다.
  • 키보드 포커스 없음: 브라우저의 키보드 focus 대신 네이티브 tap과 접근성 탐색을 사용합니다.
  • 접근성: HTML ARIA 대신 Lynx의 접근성 역할과 선택 값을 사용합니다.

Last updated on

목차