React

Radio Group

여러 옵션 중 하나를 선택할 수 있도록 할 때 사용하는 컴포넌트입니다.

Installation

npx @seed-design/cli@latest add ui:radio-group

Props

RadioGroup

Prop

Type

label?React.ReactNode
indicator?React.ReactNode
showRequiredIndicator?boolean | undefined
description?React.ReactNode
errorMessage?React.ReactNode
name?string | undefined
form?string | undefined
value?string | undefined
defaultValue?string | undefined
onValueChange?((value: string) => void) | undefined

RadioGroupItem

Prop

Type

label?React.ReactNode
inputProps?React.InputHTMLAttributes<HTMLInputElement> | undefined
rootRef?React.Ref<HTMLLabelElement> | undefined
valuestring
disabled?boolean | undefined

Radiomark

Prop

Type

Examples

Sizes

Tones

Brand

Neutral

Weights

Long Label

Disabled

Listening to Value Changes

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

이벤트를 활용해야 하는 경우 RadioGroupIteminputProps를 통해 내부 <input> 요소에 직접 이벤트 핸들러를 추가할 수 있습니다.

Use Cases

React Hook Form

Using Radiomark

Radiomark는 독립적인 라디오 마크 컴포넌트로, Radio Group Primitive 컴포넌트와 조합하여 커스텀 레이아웃을 위해 사용할 수 있습니다.

RadioGroupField Integration

label, description, errorMessage 등의 RadioGroupField 관련 prop을 사용할 수 있습니다.

Last updated on

On this page