본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Popover

원문 보기 위키 갱신

Popover는 특정 사용자 인터페이스 요소에 주의를 끌기 위해 사용하는 컴포넌트예요. 상대적 위치 지정으로 콘텐츠를 표시하고 캐럿(caret) 위치와 너비·높이·오버플로를 조절할 수 있습니다.

출처: 문서

본문

React 예제

기본

<Popover relative open>
  <Popover.Content>Popover content</Popover.Content>
</Popover>

Props

Popover

이름 기본값 타입 설명
as div string 컴포넌트의 기본 HTML 태그를 설정합니다.
caret 'top' 'top' | 'bottom' | 'left' | 'right' | 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right' | 'left-bottom' | 'left-top' | 'right-bottom' | 'right-top' 캐럿의 위치를 제어합니다.
open false boolean popover의 표시 여부를 제어합니다.
relative false boolean true로 설정하면 상대적 위치 지정으로 popover를 렌더링합니다.

Popover.Content

이름 기본값 타입 설명
as div string 컴포넌트의 기본 HTML 태그를 설정합니다.
width 'small' 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'auto' popover 콘텐츠의 너비를 설정합니다.
height 'fit-content' 'small' | 'medium' | 'large' | 'xlarge' | 'fit-content' | 'auto' popover 콘텐츠의 높이를 설정합니다.
overflow 'auto' 'auto' | 'hidden' | 'scroll' | 'visible' popover 콘텐츠의 오버플로 동작을 설정합니다.
onClickOutside (event: MouseEvent | TouchEvent) => void popover 콘텐츠 바깥에서 클릭이 감지되면 호출되는 콜백.
onEscape (event: KeyboardEvent) => void popover가 열려 있는 동안 Escape 키를 누르면 호출되는 콜백.
ignoreClickRefs React.RefObject<HTMLElement>[] 바깥 클릭을 감지할 때 무시해야 할 요소들의 ref.

관련 컴포넌트

  • PointerBox

더 알아보기 (Learn more)