Skip to content

prosekit/solid/popover

import {
  PopoverPopup,
  PopoverPositioner,
  PopoverRoot,
  PopoverTrigger,
} from 'prosekit/solid/popover'

<PopoverRoot>
  <PopoverTrigger>...</PopoverTrigger>
  <PopoverPositioner>
    <PopoverPopup>...</PopoverPopup>
  </PopoverPositioner>
</PopoverRoot>

Props for the PopoverPopup Solid component.


Props for the PopoverPositioner Solid component.

strategy?: "fixed" | "absolute"

The strategy to use for positioning

"absolute"

placement?: Placement

The initial placement of the floating element

"top"

autoUpdate?: boolean | AutoUpdateOptions

Options to activate auto-update listeners

https://floating-ui.com/docs/autoUpdate

true

hoist?: boolean

Whether to use the browser Popover API to place the floating element on top of other page content.

true

offset?: OffsetOptions

The distance between the reference and floating element.

6

flip?: boolean | Placement[]

Whether to flip the placement in order to keep it in view when the preferred placement(s) will overflow the clipping boundary. You can also provide an array of placements to try sequentially if the preferred placement does not fit.

true

shift?: boolean

Whether the floating element should shift to keep it in view.

true

overlap?: boolean

Whether the floating element can overlap the reference element to keep it in view.

false

fitViewport?: boolean

Whether to constrain the floating element's width and height to not exceed the viewport.

false

sameWidth?: boolean

Whether to constrain the floating element's width so that it matches the reference element.

false

sameHeight?: boolean

Whether to constrain the floating element's height so that it matches the reference element.

false

inline?: boolean

Whether to improve positioning for inline reference elements that span over multiple lines.

false

hide?: boolean

Whether to hide the floating element when the reference element or the floating element is fully clipped.

false

boundary?: Boundary

Describes the clipping element(s) or area that overflow will be checked relative to. Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.

'clippingAncestors'

rootBoundary?: RootBoundary

Describes the root boundary that the element will be checked for overflow relative to. Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.

'viewport'

overflowPadding?: number

Describes the virtual padding around the boundary to check for overflow. Please see https://floating-ui.com/docs/detectoverflow#padding for more information.

4

elementContext?: ElementContext

The element that will be used to check for overflow. Please see https://floating-ui.com/docs/detectoverflow#elementcontext for more information.

'floating'

altBoundary?: boolean

Whether to check the alternate elementContext's boundary. Please see https://floating-ui.com/docs/detectoverflow#altboundary for more information.

false


Props for the PopoverRoot Solid component.

modal?: boolean

Whether the popover should be modal. When true, the popover will trap focus and prevent interaction with the rest of the page.

false

defaultOpen?: boolean

Whether the overlay is initially open.

false

open?: boolean | null

Whether the overlay is currently open.

null

disabled?: boolean

Whether the component should ignore user interaction.

false

onOpenChange?: (event: OpenChangeEvent) => void

Emitted when the popover is opened or closed.


Props for the PopoverTrigger Solid component.

disabled?: boolean

Whether the component should ignore user interaction.

false

openOnHover?: boolean

Whether the popover should also open when the trigger is hovered.

false

delay?: number

The delay in milliseconds before opening the popover when hovering. Only applies when openOnHover is true.

300

closeDelay?: number

The delay in milliseconds before closing the popover when hover ends. Only applies when openOnHover is true.

0

onOpenChange?: (event: OpenChangeEvent) => void

Emitted when the popover is opened or closed.

const PopoverPopup: Component<PopoverPopupProps & JSX.HTMLAttributes<PopoverPopupElement>>

A Solid component that renders an prosekit-popover-popup custom element.


const PopoverPositioner: Component<PopoverPositionerProps & JSX.HTMLAttributes<PopoverPositionerElement>>

A Solid component that renders an prosekit-popover-positioner custom element.


const PopoverRoot: Component<PopoverRootProps & JSX.HTMLAttributes<PopoverRootElement>>

A Solid component that renders an prosekit-popover-root custom element.


const PopoverTrigger: Component<PopoverTriggerProps & JSX.HTMLAttributes<PopoverTriggerElement>>

A Solid component that renders an prosekit-popover-trigger custom element.