Skip to content

prosekit/svelte/inline-popover

import {
  InlinePopoverPopup,
  InlinePopoverPositioner,
  InlinePopoverRoot,
} from 'prosekit/svelte/inline-popover'

<InlinePopoverRoot>
  <InlinePopoverPositioner>
    <InlinePopoverPopup>...</InlinePopoverPopup>
  </InlinePopoverPositioner>
</InlinePopoverRoot>

Props for the InlinePopoverPopup Svelte component.

children?: Snippet<[]>


Props for the InlinePopoverPositioner Svelte component.

placement?: Placement

The initial placement of the floating element

"top"

offset?: OffsetOptions

The distance between the reference and floating element.

12

hide?: boolean

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

true

hoist?: boolean

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

false

overlap?: boolean

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

true

inline?: boolean

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

true

overflowPadding?: number

Describes the virtual padding around the boundary to check for overflow.

8

strategy?: "fixed" | "absolute"

The strategy to use for positioning

"absolute"

autoUpdate?: boolean | AutoUpdateOptions

Options to activate auto-update listeners

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

true

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

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

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'

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

children?: Snippet<[]>


Props for the InlinePopoverRoot Svelte component.

defaultOpen?: boolean

Whether the popover is open by default when some inline content is selected.

true

dismissOnEscape?: boolean

Whether the inline popover should be dismissed when the editor receives an Escape key press.

true

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 open state of the popover changes.

children?: Snippet<[]>

const InlinePopoverPopup: Component<InlinePopoverPopupProps & HTMLAttributes<InlinePopoverPopupElement>>

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


const InlinePopoverPositioner: Component<InlinePopoverPositionerProps & HTMLAttributes<InlinePopoverPositionerElement>>

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


const InlinePopoverRoot: Component<InlinePopoverRootProps & HTMLAttributes<InlinePopoverRootElement>>

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