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

Popover

트리거 요소에 앵커링되어 화면 위에 떠 있는 컨테이너입니다. Header/Body/Footer 구조로 부가 정보나 액션을 제공할 때 사용됩니다.

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

Installation

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

Props

PopoverRoot

Prop

Type

strategy?"absolute" | "fixed" | undefined

The strategy to use for positioning

Default

"absolute"

flip?boolean | Placement[] | undefined

Whether to flip the placement

Default

true

slide?boolean | undefined

Whether the popover should slide when it overflows.

Default

true

arrowPadding?number | undefined

The minimum padding between the arrow and the floating element's corner.

Default

4

defaultOpen?boolean | undefined

Whether the floating element is initially open

open?boolean | undefined

Whether the floating element is open

onOpenChange?((open: boolean, details?: PopoverChangeDetails | undefined) => void) | undefined

Callback when the floating element is opened or closed. details is whatever the caller's getChangeDetails produced, or whatever it passed to the returned onOpenChange; a floating element that reports no reason leaves it undefined.

closeOnInteractOutside?boolean | undefined

Whether to close the popover when pressing outside of it or moving focus out of it.

Default

true

autoFocus?boolean | undefined

Whether to move focus into the content when the popover opens.

Default

true

unmountOnExit?boolean | undefined

Whether to unmount on exit.

Default

false

childrenReact.ReactNode
placement?Placement | undefined

Default

"bottom"

gutter?number | undefined

Default

8

overflowPadding?number | undefined

Default

16

lazyMount?boolean | undefined

Default

true

PopoverTrigger

Prop

Type

asChild?boolean | undefined

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

Default

false

PopoverAnchor

Prop

Type

asChild?boolean | undefined

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

Default

false

PopoverContent

Prop

Type

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

Default

true

positionerContainer?React.RefObject<HTMLElement | null> | undefined
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

PopoverBody

Prop

Type

asChild?boolean | undefined

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

Default

false

height?ResponsiveValue<"full" | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.betweenText" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | Dimension | (string & {})> | undefined
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

PopoverFooter

Prop

Type

asChild?boolean | undefined

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

Default

false

PopoverAction

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"

Examples

Trigger

<PopoverTrigger>는 aria-haspopup="dialog" 속성을 설정하고, Popover의 open 상태에 따라 aria-expanded 속성을 자동으로 설정합니다. 열려 있는 동안에는 <PopoverContent>를 가리키는 aria-controls 속성도 함께 설정합니다. 이 속성은 스크린 리더와 같은 보조 기술에 유용합니다.

Controlled

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

Open Change

onOpenChange(open, details)에서 열림 상태가 바뀐 이유를 확인할 수 있습니다.

  • trigger: 트리거로 열거나 닫음
  • closeButton: PopoverAction 또는 닫기 버튼으로 닫음
  • escapeKeyDown: Escape 키로 닫음
  • interactOutside: 외부 영역을 눌러 닫음
  • focusOut: Tab 등으로 포커스가 밖으로 이동하여 닫음
  • cascadeDismiss: 상위 레이어가 닫혀 함께 닫음

cascadeDismiss는 details.dismissedParent를, 나머지는 details.event를 제공합니다. focusOut의 이벤트는 FocusEvent입니다.

Popover는 열릴 때 콘텐츠로 포커스를 옮기지만 가두지 않습니다. closeOnInteractOutside={false}가 아니라면 Tab 등으로 포커스가 밖으로 이동할 때 닫히며, 이동한 곳의 포커스를 유지합니다.

Placement

<PopoverRoot>에 placement prop을 설정하여 트리거 기준 위치를 지정합니다. 뷰포트 경계를 벗어나면 자동으로 뒤집히거나(flip) 이동합니다(shift).

Anchor

<PopoverAnchor>를 사용하면 트리거와 분리된 요소를 기준으로 Popover의 위치를 잡을 수 있습니다. 이 경우 열림 상태는 open prop으로 직접 제어합니다.

Scroll

<PopoverContent>의 max-height(600px)를 넘는 긴 콘텐츠는 <PopoverBody>가 스크롤됩니다. 콘텐츠가 실제로 넘칠 때에만 하단에 scroll fog가 표시되고, 위에 Header가 있는 Body를 아래로 스크롤하면 상단에 divider가 나타납니다. 뷰포트가 작으면 max-height는 가용 높이에 맞춰 줄어듭니다.

Show Close Button

<PopoverContent>에 showCloseButton prop을 전달하여 닫기 버튼 표시 여부를 제어합니다. 기본값은 true이며, 표시될 때 Header 우측에 여백이 확보됩니다.

Prevent Close

PopoverAction의 onClick에서 e.preventDefault()를 호출하면 Popover가 닫히지 않습니다.

Last updated on 2026. 10. 29.