Skip to content

Type Alias: UseDriverPositionOptions ​

ts
type UseDriverPositionOptions = {
  align: MaybeRefOrGetter<Alignment>;
  arrow?: Ref<HTMLElement | null>;
  centered?: MaybeRefOrGetter<boolean>;
  floating: Ref<HTMLElement | null>;
  offset?: MaybeRefOrGetter<number>;
  open?: MaybeRefOrGetter<boolean>;
  padding?: MaybeRefOrGetter<number>;
  reference: MaybeRefOrGetter<Element | StageRect | undefined | null>;
  side: MaybeRefOrGetter<Side>;
  strategy?: "fixed" | "absolute";
};

Properties ​

PropertyTypeDescription
alignMaybeRefOrGetter<Alignment>-
arrow?Ref<HTMLElement | null>The arrow element, when there is one.
centered?MaybeRefOrGetter<boolean>Ignore the reference and center the popover in the viewport (modal-like).
floatingRef<HTMLElement | null>The popover element.
offset?MaybeRefOrGetter<number>Gap between the (padded) reference and the popover.
open?MaybeRefOrGetter<boolean>Positioning only runs while open.
padding?MaybeRefOrGetter<number>Expands the reference rect on every side, so the popover clears the stage cutout.
referenceMaybeRefOrGetter<Element | StageRect | undefined | null>The element (or a static rect) the popover points at.
sideMaybeRefOrGetter<Side>-
strategy?"fixed" | "absolute"fixed (default) positions in the viewport; absolute positions in the document, so the element scrolls natively with the page. (Floating UI strategy)

Released under the MIT License.