FloatingProps
Extends
PropsWithChildren
Properties
arrow?
optionalarrow:Omit<FloatingArrowProps,"context"> &object
The arrow to display in the floating component
Type declaration
enabled?
optionalenabled:boolean
Whether to render the arrow or not
middlewareDataArrowStyles()?
optionalmiddlewareDataArrowStyles: (middlewareData) =>CSSProperties
Styles for the arrow based on middleware data
Parameters
middlewareData
MiddlewareData
The middleware data
Returns
CSSProperties
The styles for the arrow
padding?
optionalpadding:number|SideObject
The padding of the arrow
children?
optionalchildren:ReactNode
Inherited from
PropsWithChildren.children
clickProps?
optionalclickProps:UseClickProps
floating ui useClick props (if floating component is in controlled mode, enabled prop will be ignored)
See
https://floating-ui.com/docs/useClick
dismissProps?
optionaldismissProps:UseDismissProps
floating ui useDismiss props (if floating component is in controlled mode, enabled prop will be ignored)
See
https://floating-ui.com/docs/useDismiss
floatingComponent?
optionalfloatingComponent:ReactNode| (props) =>ReactNode
The floating component to render (can be a string, a ReactNode, or a function that returns a ReactNode)
Examples
<Floating floatingComponent='Hello world' />
<Floating floatingComponent={(open, placement) => <div>{open ? 'Hello world' : 'Goodbye world'}</div>} />
focusProps?
optionalfocusProps:UseFocusProps
floating ui useFocus props (if floating component is in controlled mode, enabled prop will be ignored)
See
https://floating-ui.com/docs/useFocus
hideMiddleware?
optionalhideMiddleware:boolean
Whether to use the hide middleware or not
Default
true
See
https://floating-ui.com/docs/middleware/hide
hoverProps?
optionalhoverProps:UseHoverProps
floating ui useHover props (if floating component is in controlled mode, enabled prop will be ignored)
See
https://floating-ui.com/docs/useHover
initialOpen?
optionalinitialOpen:boolean
Whether the floating component is open or not at initial render (uncontrolled mode) (if you want to control the floating component from outside, use the open and setOpen props)
Default
false
See
https://reactjs.org/docs/uncontrolled-components.html
middleware?
optionalmiddleware: (undefined|null|false| {name:string;options:any;fn:Promisable<MiddlewareReturn>; })[]
The middleware to use for the floating component (useful when you want to add custom behaviors to the floating component)
See
https://floating-ui.com/docs/middleware
middlewareDataFloatingStyles()?
optionalmiddlewareDataFloatingStyles: (middlewareData) =>CSSProperties
Styles for the floating component based on middleware data
Parameters
middlewareData
MiddlewareData
The middleware data
Returns
CSSProperties
The styles for the floating component
onToggle()?
optionalonToggle: (open) =>void
The function to call when the floating component open state changes (uncontrolled mode) (if you want to control the floating component from outside, use the open and setOpen props)
Parameters
open
boolean
Whether the new floating component open state was true or not
Returns
void
open?
optionalopen:null|boolean
Whether the floating component is open or not
Default
null
See
https://reactjs.org/docs/forms.html#controlled-components
placement?
optionalplacement:Placement
The placement of the floating component relative to the reference element
Default
'bottom'
portal?
optionalportal:boolean
Whether to render the floating component in a portal
Default
true
See
https://reactjs.org/docs/portals.html
roleProps?
optionalroleProps:UseRoleProps
floating ui useRole props (if floating component is in controlled mode, enabled prop will be ignored)
See
https://floating-ui.com/docs/useRole
Root?
optionalRoot:ElementType
The root element of the floating component
Default
'div'
setOpen()?
optionalsetOpen: (open) =>void
Manually set the open state of the floating component (useful when the floating component is controlled from outside)
Parameters
open
boolean
The new open state
Returns
void
strategy?
optionalstrategy:Strategy
The strategy to use for positioning the floating component
Default
'absolute'
transitionProps?
optionaltransitionProps:UseTransitionStylesProps
The props for the floating component transition