Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FixedPositioningOptions<FixedToElement, FixedElement>

remarks

@since 4.0.0

Type parameters

  • FixedToElement: HTMLElement

    An HTMLElement type for the static element.

  • FixedElement: HTMLElement

    An HTMLElement type for the fixed element.

Hierarchy

Index

Properties

Optional anchor

anchor?: PositionAnchor

The configuration to anchor the fixed element to the container element.

defaultvalue

BELOW_CENTER_ANCHOR

Optional disableSwapping

disableSwapping?: boolean

Boolean if the auto-swapping behavior should be disabled. It's normally recommended to not disable this since it'll allow elements to appear off screen.

defaultvalue

false

Optional disableVHBounds

disableVHBounds?: boolean

Boolean if the fixed positioning should no longer prevent the fixed element to be positioned within the viewport. This is nice if you want to allow for full page scrolling instead and manually set a max-height on your element.

defaultvalue

false

fixedTo

fixedTo: RefObject<FixedToElement>

A ref pointing to an element that another element should be fixed to. This must be provided for the positioning to work.

Optional initialX

initialX?: number

The initial x value to use when calculating the position instead of finding the container element to determine the the correct position. All the other positioning logic will still be in effect to ensure the element will be visible within the viewport.

Optional initialY

initialY?: number

The initial y value to use when calculating the position instead of finding the container element to determine the the correct position. All the other positioning logic will still be in effect to ensure the element will be visible within the viewport.

Optional nodeRef

nodeRef?: Ref<FixedElement>

{@inheritDoc TransitionOptions.nodeRef}

Optional onEnter

This function will be called once the TransitionStage has been set to "enter".

see

TransitionEnterHandler

Optional onEntered

This function will be called once the TransitionStage has been set to "entering".

see

TransitionEnterHandler

Optional onEntering

This function will be called once the TransitionStage has been set to "enter".

see

TransitionEnterHandler

Optional onExited

This function will be called once the TransitionStage has been set to "exited".

see

TransitionExitHandler

Optional onResize

onResize?: EventListener

An optional function to call if the page resizes while the {@link FixedElement} is visible.

Optional onScroll

onScroll?: TransitionScrollCallback<FixedToElement, FixedElement>

{@inheritDoc TransitionScrollCallback}

Optional preventOverlap

preventOverlap?: boolean

Boolean if the fixed element should no longer be able to overlap the container element. This is useful for autocomplete menus or other components that retain focus on the container element while the fixed element becomes visible.

defaultvalue

false

Optional style

style?: CSSProperties

An optional style that will be merged with the fixed positioning required styles.

see

FixedPositionStyle

Optional transformOrigin

transformOrigin?: boolean

Boolean if the style object should include the transformOrigin value based on the x and y positions.

defaultvalue

false

Optional vhMargin

vhMargin?: number

The viewwidth margin to apply so that the element doesn't need to be directly on the screen edge.

defaultvalue

16

Optional vwMargin

vwMargin?: number

The viewwidth margin to apply so that the element doesn't need to be directly on the screen edge.

defaultvalue

16

Optional width

width?: PositionWidth

{@inheritDoc PositionWidth}

Optional xMargin

xMargin?: number

The container width margin to apply so that the element doesn't need to be directly on the container's edge.

defaultvalue

0

Optional yMargin

yMargin?: number

The container height margin to apply so that the element doesn't need to be directly on the container's edge

defaultvalue

0

Methods

Optional getFixedPositionOptions

  • getFixedPositionOptions(): CalculateFixedPositionOptions
  • An optional function that can be used to override positioning options if some options require the element to be in the DOM for specific calculations.

    Returns CalculateFixedPositionOptions

Generated using TypeDoc