Bootstrap

API floatingUI

createFloatingUI

function

createFloatingUI(propsConfig?): object

Create a floating UI service.

The returned service includes the patch method to patch the states, the stores to track the states and directives to apply.

Parameters

propsConfig?: PropsConfig<FloatingUIProps>

the props config for the floating UI service

Returns

object

the floating UI service

directives

directives: object

directives.arrowDirective

arrowDirective: Directive<void, SSRHTMLElement>

Directive to be used on the arrow element, if any

directives.floatingDirective

floatingDirective: Directive<void, SSRHTMLElement>

Directive to be used on the floating element

directives.referenceDirective

referenceDirective: Directive<void, SSRHTMLElement>

Directive to be used on the reference element from where the floating element will be positioned

patch

patch: <U>(storesValues?) => void

Type Parameters

U extends Partial<FloatingUIProps>

Parameters

storesValues?: void | U

Returns

void

state$

state$: ReadableSignal<FloatingUIState>

stores

stores: object

stores.middlewareData$

middlewareData$: ReadableSignal<undefined | MiddlewareData>

stores.placement$

placement$: ReadableSignal<undefined | Placement>

stores.strategy$

strategy$: ReadableSignal<undefined | Strategy>

stores.x$

x$: ReadableSignal<undefined | number>

stores.y$

y$: ReadableSignal<undefined | number>


FloatingUI

type alias

FloatingUI: ReturnType<*typeof* createFloatingUI>


FloatingUIProps

interface
Properties
arrowOptions

arrowOptions: Omit<object, "element"> | Derivable<Omit<object, "element">>

Options to use when calling the arrow middleware from Floating UI


autoUpdateOptions

autoUpdateOptions: AutoUpdateOptions

Options to use when calling autoUpdate from Floating UI


computePositionOptions

computePositionOptions: object

Options to use when calling computePosition from Floating UI

middleware?

optional middleware: (undefined | null | false | object)[]

Array of middleware objects to modify the positioning or provide data for rendering.

placement?

optional placement: Placement

Where to place the floating element relative to the reference element.

platform?

optional platform: Platform

Custom or extended platform object.

strategy?

optional strategy: Strategy

The strategy to use when positioning the floating element.


FloatingUIState

interface
Properties
middlewareData

middlewareData: undefined | MiddlewareData

Object containing data returned from all middleware, keyed by their name


placement

placement: undefined | Placement

The final chosen placement of the floating element


strategy

strategy: undefined | Strategy

The strategy used to position the floating element


x

x: undefined | number

The x coordinate of the floating ui


y

y: undefined | number

The y coordinate of the floating ui