Skip to contentSkip to navigationSkip to topbar
Paste assistant Assistant
Figma
Star

Popover

Version 13.2.0GithubStorybook

A Popover is a page overlay triggered by a button that displays additional interactive content.

Installation

Installation page anchor
yarn add @twilio-paste/popover - or - yarn add @twilio-paste/core
import {Popover, PopoverContainer, PopoverButton} from '@twilio-paste/core/popover';

const PopoverExample: React.FC = () => {
  return (
    <PopoverContainer baseId="popover-example">
      <PopoverButton variant="primary">Open popover</PopoverButton>
      <Popover aria-label="Popover">Popover content</Popover>
    </PopoverContainer>
  );
};

PopoverStateReturn

PopoverStateReturn page anchor

state

Type
PopoverStateReturn

aria-label RequiredRequired

Required label for this Popover component. Titles the entire popover context for screen readers.

Type
string

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
any
Default
'POPOVER'

i18nDismissLabel

Accessible label for the dismiss button in the Popover.

Type
string
Default
'Close popover'

initialFocusRef

A ref to an interactive element that recieves focus when the Popover opens.

Type
RefObject<any>

width

Type
any

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
any
Default
'POPOVER_BUTTON'

id

Type
string

toggle

Type
() => void

element

Overrides the default element name to apply unique styles with the Customization Provider

Type
any
Default
'POPOVER_BADGE'

id

Type
string

toggle

Type
() => void