프리뷰 또는 이전 버전의 문서를 보고 있습니다.seed-design.io 방문
우리는 왜 디자인 엔지니어를 찾게 됐을까
Skip to Content
React

Dialog

화면 중앙에 떠서 사용자의 주의를 모으는 다이얼로그입니다. 제목, 본문, 푸터와 닫기 버튼을 갖추어 폼이나 스크롤되는 콘텐츠 등 풍부한 내용을 담을 때 사용합니다.

사용 가능 버전@seed-design/[email protected], @seed-design/[email protected]

Alert Dialog

사용자의 확인이나 경고가 목적이라면 Alert Dialog를 사용하세요.

Installation

Default

화면 중앙에 떠서 제목, 본문, 푸터를 담는 기본 Dialog 컴포넌트를 포함합니다.

npx @seed-design/cli@latest add ui:dialog

Responsive

뷰포트에 따라 Bottom Sheet로 자동 전환되는 반응형 변형입니다.

npx @seed-design/cli@latest add ui:responsive-dialog

Props

DialogRoot

Prop

Type

closeOnInteractOutside?boolean | undefined

Default

false

open?boolean | undefined
defaultOpen?boolean | undefined
onOpenChange?((open: boolean, details?: DialogChangeDetails) => void) | undefined
modal?boolean | undefined

Whether the dialog should behave as a modal overlay. When true, focus is trapped, background content is hidden from assistive technology, and aria-modal is set. Set to false to temporarily suspend modal behavior (e.g., when a Stackflow Activity is pushed on top of a mounted dialog).

Default

true

closeOnEscape?boolean | undefined

Whether to close the dialog when the escape key is pressed

Default

true

childrenReact.ReactNode
size?"large" | "medium" | undefined

Default

"medium"

lazyMount?boolean | undefined

Default

true

unmountOnExit?boolean | undefined

Default

true

DialogTrigger

Prop

Type

asChild?boolean | undefined

Whether the element should be rendered as a child of a slot.

Default

false

DialogContent

Prop

Type

title?React.ReactNode
description?React.ReactNode
layerIndex?number | undefined
showCloseButton?boolean | undefined

Default

true

width?ResponsiveValue<"full" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | Dimension | (string & {})> | undefined
maxWidth?ResponsiveValue<"full" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | Dimension | (string & {})> | undefined

DialogBody

Prop

Type

asChild?boolean | undefined

Whether the element should be rendered as a child of a slot.

Default

false

minHeight?ResponsiveValue<"full" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | Dimension | (string & {})> | undefined
maxHeight?ResponsiveValue<"full" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | Dimension | (string & {})> | undefined
paddingX?ResponsiveValue<"spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {})> | undefined
justifyContent?"center" | "flex-end" | "flex-start" | "space-around" | "space-between" | undefined
alignItems?"center" | "flex-end" | "flex-start" | "stretch" | undefined

DialogFooter

Prop

Type

asChild?boolean | undefined

Whether the element should be rendered as a child of a slot.

Default

false

DialogAction

Prop

Type

asChild?boolean | undefined

Whether the element should be rendered as a child of a slot.

Default

false

variant?"brandOutline" | "brandSolid" | "criticalSolid" | "ghost" | "neutralOutline" | "neutralSolid" | "neutralWeak" | undefined
  • brandSolid: 브랜드의 핵심 가치를 전달하며, 사용자 간 연결이 일어나는 서비스의 주요 기능에 사용합니다. 한 화면에 하나만 사용하는 것을 권장합니다.
  • neutralSolid: 대부분의 화면에서 CTA로 사용합니다. 한 화면에 하나만 사용하는 것을 권장합니다.
  • neutralWeak: CTA를 제외한 대부분의 액션에 사용됩니다.
  • criticalSolid: 삭제나 초기화처럼 되돌릴 수 없는 중요한 작업에 사용합니다.
  • brandOutline: variant=brandSolid, neutralSolid, criticalSolid와 함께 사용할 수 없으며, variant=neutralOutline과 조합하여 사용하는 것을 권장합니다.
  • neutralOutline: variant=brandSolid, neutralSolid, criticalSolid와 함께 사용할 수 없으며, variant=brandOutline과 조합하여 사용하는 것을 권장합니다.
  • ghost: 배경 없이 텍스트와 아이콘만 표시됩니다. 모두 동일한 색상을 사용하는 조건에서 icon, prefix icon, suffix icon, label에 정의된 color를 변경할 수 있으며, label의 fontWeight를 $font-weight.regular 또는 $font-weight.medium으로 변경하여 주목도를 조절할 수 있습니다.

Default

"brandSolid"

size?"large" | "medium" | "small" | "xsmall" | undefined
  • xsmall: 작은 공간에서 효율적으로 사용할 수 있는 Pill 형태로 제공됩니다.
  • small: 화면 중앙에서 범용적으로 사용됩니다.
  • medium: 화면 중앙에서 범용적으로 사용됩니다.
  • large: 주로 CTA 역할로 사용됩니다.

Default

"medium"

layout?"iconOnly" | "withText" | undefined
  • withText: 텍스트와 함께 아이콘을 표시할 수 있습니다.
  • iconOnly: 아이콘만으로 의미를 전달하기 때문에 접근성이 떨어집니다. 꼭 필요한 경우에만 접근성 레이블과 함께 사용하는 것을 권장합니다.

Default

"withText"

bleed?ResponsiveValue<"asPadding" | "safeArea" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {})> | undefined

Negative margin on all four sides to extend the element outside its parent. If set to "asPadding", it will use the padding value in the same direction. If set to "safeArea", it will use the safe area inset in the same direction.

Cannot be combined with any margin* prop.

bleedX?ResponsiveValue<"asPadding" | "safeArea" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {})> | undefined

Negative x-axis margin to extend the element outside its parent. If set to "asPadding", it will use the padding value in the same direction. If set to "safeArea", it will use the safe area inset in the same direction.

Cannot be combined with any margin* prop.

bleedY?ResponsiveValue<"asPadding" | "safeArea" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | 0 | Dimension | (string & {})> | undefined

Negative y-axis margin to extend the element outside its parent. If set to "asPadding", it will use the padding value in the same direction. If set to "safeArea", it will use the safe area inset in the same direction.

Cannot be combined with any margin* prop.

flexGrow?0 | 1 | true | (number & {}) | undefined

If true, flex-grow will be set to 1.

loading?boolean | undefined

버튼에 등록된 비동기 작업이 진행 중임을 사용자에게 알립니다.

Default

false

color?ScopedColorFg | ScopedColorPalette | undefined

Color of the label and icons inside the button. Works only when variant is ghost.

Default

"fg.neutral"

fontWeight?"bold" | "medium" | "regular" | undefined

Weight of the label. Works only when variant is ghost.

Default

"bold"

ResponsiveDialogRoot

Prop

Type

children?React.ReactNode
open?boolean | undefined
defaultOpen?boolean | undefined
onOpenChange?((open: boolean) => void) | undefined
dialogBreakpoint?"lg" | "md" | "sm" | "xl" | undefined

Breakpoint at and above which it renders as a Dialog; below it, a BottomSheet. Cannot be "base", which would always be a Dialog.

Default

"md"

dialogRootProps?Omit<DialogRootProps, "children" | "defaultOpen" | "onOpenChange" | "open"> | undefined

Props forwarded to the underlying Dialog root (at and above the breakpoint).

bottomSheetRootProps?Omit<BottomSheetRootProps, "children" | "defaultOpen" | "onOpenChange" | "open"> | undefined

Props forwarded to the underlying BottomSheet root (below the breakpoint).

Examples

Trigger

<DialogTrigger>는 aria-haspopup="dialog" 속성을 설정하고, Dialog의 open 상태에 따라 aria-expanded 속성을 자동으로 설정합니다. 이 속성은 스크린 리더와 같은 보조 기술에 유용합니다.

Controlled

Trigger 외의 방식으로 Dialog를 열고 닫을 수 있습니다. 이 경우 open prop을 사용하여 Dialog의 상태를 제어합니다.

Size

<DialogRoot>에 size prop을 설정하여 Dialog의 너비를 변경할 수 있습니다. "medium" (480px, 기본값)과 "large" (800px)를 지원합니다. md 미만 화면에서는 뷰포트 너비의 90%를 차지하고, md 이상에서 각 size의 최대 너비가 적용됩니다. content의 높이는 뷰포트의 80%로 제한됩니다.

<DialogContent>에 width, maxWidth prop을 전달하여 너비를 직접 제어할 수도 있습니다. 프리셋 size 대신 뷰포트 기반의 유동적인 너비가 필요할 때 사용합니다. 단일 값은 모든 breakpoint에 적용되므로, md 미만의 기본 너비(뷰포트의 90%)를 유지하려면 width={{ md: "560px" }}처럼 breakpoint 객체로 전달하세요.

Body

<DialogBody>는 본문 영역을 스크롤 가능하게 만듭니다. 본문이 길어 스크롤되면 헤더 아래에 구분선이 나타나고, 하단은 서서히 사라지는 마스크가 적용됩니다. Body가 뷰포트 높이를 넘겨 스크롤이 생길 때에만 하단 fade 마스크와 padding-bottom이 적용됩니다. 본문이 짧아 넘치지 않으면 마스크가 적용되지 않아 마지막 줄이 흐려지지 않습니다.

Custom Body

<DialogBody>에 paddingX, minHeight, maxHeight, justifyContent, alignItems prop을 전달하여 본문 영역을 직접 제어할 수 있습니다. 기본 캡(뷰포트의 80%)보다 낮게 스크롤 높이를 제한하거나, 짧은 내용에서도 높이를 고정하거나, 가로 패딩을 제거해 콘텐츠를 가장자리까지 배치할 때 사용합니다.

Show Close Button

<DialogContent>에 showCloseButton prop을 전달하여 우측 상단 닫기 버튼을 표시할 수 있습니다. 기본 값은 true입니다.

DialogFooter는 flex 레이아웃만 제공하며, 버튼 배치는 VStack, HStack 등으로 직접 구성합니다.

Prevent Close

DialogAction의 onClick에서 e.preventDefault()를 호출하면 다이얼로그가 닫히지 않습니다.

onOpenChange Details

onOpenChange 두 번째 인자로 details가 제공됩니다.

reason

열릴 때 (open: true)

  • "trigger": DialogTrigger로 열림

닫힐 때 (open: false)

  • "closeButton": DialogAction 또는 우측 상단 닫기 버튼으로 닫힘
  • "escapeKeyDown": ESC 키 사용
  • "interactOutside": 외부 영역 클릭
    • DialogRoot는 기본적으로 closeOnInteractOutside={false}입니다. interactOutside는 이 옵션을 true로 설정한 경우에만 발생할 수 있습니다.
  • "cascadeDismiss": 상위 레이어 닫힘으로 인한 연쇄 닫힘
마지막 열림 이유: -마지막 닫힘 이유: -

Confirm Before Close

작성 중인 내용을 실수로 닫는 것을 막고 싶다면, open을 제어 상태로 두고 특정 reason일 때 open을 유지한 채 확인용 Alert Dialog를 띄워 사용자에게 되물을 수 있습니다.

Portalled

Portal은 기본적으로 document.body에 렌더링됩니다.

Responsive

ResponsiveDialog를 사용하면 md 이상에서는 Dialog, sm 이하에서는 Bottom Sheet로 자동 전환됩니다. 뷰포트를 줄여서 전환 동작을 확인해보세요. onOpenChange는 열림 상태만 전달하며, Dialog 또는 Bottom Sheet에만 적용되는 Root 옵션은 dialogRootProps, bottomSheetRootProps로 전달합니다.

Last updated on 2026. 10. 29.