Popover
import * as Popover from '@dxos/react-ui/Popover';A popover is short content beside the control that opens it, such as a share link. It opens in a portal, and closes
when the user clicks elsewhere. With modal, it holds focus.
import * as import Button
Button from '@dxos/react-ui/Button';import * as import Input
Input from '@dxos/react-ui/Input';import * as import Popover
Popover from '@dxos/react-ui/Popover';
export const const SharePopover: () => React.JSX.Element
SharePopover = () => ( <import Popover
Popover.function Root({ lazyMount, unmountOnExit, positioning, ...props }: Popover.RootProps): React.JSX.Element
export Root
Root> <import Popover
Popover.const Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>export Trigger
Use asChild to open the popover from a Button.
Trigger PolymorphicProps.asChild?: boolean | undefined
Use the provided child element as the default rendered element, combining their props and behavior.
asChild> <import Button
Button.const Root: React.ForwardRefExoticComponent<Omit<Button.RootProps, "className"> & { classNames?: ClassNameValue;} & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLButtonElement>>export Root
Root icon?: string | undefined
Leading icon.
icon='ph--share-network--regular' label?: string | undefined
Visible text; children take precedence.
Required: names the button (aria-label) and shows in a Tooltip.
label='Share' /> </import Popover
Popover.const Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>export Trigger
Use asChild to open the popover from a Button.
Trigger> <import Popover
Popover.const Content: React.ForwardRefExoticComponent<Omit<PopoverContentProps, "className"> & { classNames?: import("@dxos/ui-types").ClassNameValue;} & { size?: Size; arrow?: boolean; container?: React.RefObject<HTMLElement | null>;} & React.RefAttributes<HTMLDivElement>>export Content
Portalled panel at level='popup', padded by the size's gap, with an arrow unless arrow={false}.
Content> <import Popover
Popover.const Header: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className"> & { classNames?: import("@dxos/ui-types").ClassNameValue;} & React.RefAttributes<HTMLDivElement>>export Header
A block row holding the Title and an optional trailing CloseTrigger.
Header> <import Popover
Popover.const Title: React.ForwardRefExoticComponent<Omit<PopoverTitleProps, "className"> & { classNames?: import("@dxos/ui-types").ClassNameValue;} & React.RefAttributes<HTMLHeadingElement>>export Title
Title>Share contact</import Popover
Popover.const Title: React.ForwardRefExoticComponent<Omit<PopoverTitleProps, "className"> & { classNames?: import("@dxos/ui-types").ClassNameValue;} & React.RefAttributes<HTMLHeadingElement>>export Title
Title> <import Popover
Popover.const CloseTrigger: React.ForwardRefExoticComponent<Omit<PopoverCloseTriggerProps, "children"> & { children?: React.ReactNode; icon?: string; label?: string;} & React.RefAttributes<HTMLButtonElement>>export CloseTrigger
CloseTrigger /> </import Popover
Popover.const Header: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "className"> & { classNames?: import("@dxos/ui-types").ClassNameValue;} & React.RefAttributes<HTMLDivElement>>export Header
A block row holding the Title and an optional trailing CloseTrigger.
Header> <import Popover
Popover.const Description: React.ForwardRefExoticComponent<Omit<PopoverDescriptionProps, "className"> & { classNames?: import("@dxos/ui-types").ClassNameValue;} & React.RefAttributes<HTMLParagraphElement>>export Description
Description>Anyone with the link can view.</import Popover
Popover.const Description: React.ForwardRefExoticComponent<Omit<PopoverDescriptionProps, "className"> & { classNames?: import("@dxos/ui-types").ClassNameValue;} & React.RefAttributes<HTMLParagraphElement>>export Description
Description> <import Input
Input.const Root: React.ForwardRefExoticComponent<Omit<Input.RootProps, "className"> & { classNames?: import("@dxos/ui-types").ClassNameValue;} & Pick<React.HTMLAttributes<Element>, "style" | "role" | "children"> & React.RefAttributes<HTMLInputElement>>export Root
Text input at control size; inside a Field.Root it takes the field's id, label and description wiring. With
start or end it renders a ControlFrame holding the adornments and a bare input; data-testid and classes then
go to the frame, the ref to the input.
Root defaultValue?: string | number | readonly string[] | undefined
defaultValue='https://example.com/c/ada' readOnly?: boolean | undefined
readOnly 'copyable'?: boolean | undefined
Trails the input with a copy button for its current value (e.g. a read-only id); replaces end.
copyable "aria-label"?: string | undefined
Defines a string value that labels the current element.
aria-label='Link' /> </import Popover
Popover.const Content: React.ForwardRefExoticComponent<Omit<PopoverContentProps, "className"> & { classNames?: import("@dxos/ui-types").ClassNameValue;} & { size?: Size; arrow?: boolean; container?: React.RefObject<HTMLElement | null>;} & React.RefAttributes<HTMLDivElement>>export Content
Portalled panel at level='popup', padded by the size's gap, with an arrow unless arrow={false}.
Content> </import Popover
Popover.function Root({ lazyMount, unmountOnExit, positioning, ...props }: Popover.RootProps): React.JSX.Element
export Root
Root>);
A popover has the parts of Dialog except Dialog.Footer, plus Popover.Anchor. Use
Popover.Anchor when you position the popover against an element other than its trigger.
Popover.Content draws an arrow toward the trigger by default. Pass arrow={false} to leave the arrow out.