prosekit/react/autocomplete
Anatomy
Section titled “Anatomy”Interfaces
Section titled “Interfaces”AutocompleteEmptyProps
Section titled “AutocompleteEmptyProps”Props for the AutocompleteEmpty React component.
AutocompleteItemProps
Section titled “AutocompleteItemProps”Props for the AutocompleteItem React component.
Properties
Section titled “Properties”-
value?:string -
The value of the item, which will be matched against the query.
If not provided, the value is the item's text content.
Default
Section titled “Default”""
-
disabled?:boolean -
Whether this option is disabled.
Default
Section titled “Default”false
-
onSelect?: (event:SelectEvent) =>void -
Emitted when the the item is selected.
AutocompletePopupProps
Section titled “AutocompletePopupProps”Props for the AutocompletePopup React component.
Properties
Section titled “Properties”-
onValueChange?: (event:ValueChangeEvent) =>void -
Emitted when the selected value changes. Only available when multiple is false.
-
onValuesChange?: (event:ValuesChangeEvent) =>void -
Emitted when the selected values change. Only available when multiple is true.
AutocompletePositionerProps
Section titled “AutocompletePositionerProps”Props for the AutocompletePositioner React component.
Properties
Section titled “Properties”-
placement?:Placement -
The placement of the popover, relative to the text cursor.
Default
Section titled “Default”"bottom-start"
-
offset?:OffsetOptions -
The distance between the popover and the hovered block.
Default
Section titled “Default”4
-
inline?:boolean -
Default
Section titled “Default”true
-
hoist?:boolean -
Default
Section titled “Default”true
-
fitViewport?:boolean -
Default
Section titled “Default”true
-
boundary?:Boundary -
Default
Section titled “Default”
-
overflowPadding?:number -
Default
Section titled “Default”8
-
strategy?:"fixed"|"absolute" -
The strategy to use for positioning
Default
Section titled “Default”"absolute"
-
autoUpdate?:boolean|AutoUpdateOptions -
Options to activate auto-update listeners
https://floating-ui.com/docs/autoUpdate
Default
Section titled “Default”true
-
flip?:boolean|Placement[] -
Whether to flip the
placementin 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 preferredplacementdoes not fit.Default
Section titled “Default”true
-
shift?:boolean -
Whether the floating element should shift to keep it in view.
Default
Section titled “Default”true
-
overlap?:boolean -
Whether the floating element can overlap the reference element to keep it in view.
Default
Section titled “Default”false
-
sameWidth?:boolean -
Whether to constrain the floating element's width so that it matches the reference element.
Default
Section titled “Default”false
-
sameHeight?:boolean -
Whether to constrain the floating element's height so that it matches the reference element.
Default
Section titled “Default”false
-
hide?:boolean -
Whether to hide the floating element when the reference element or the floating element is fully clipped.
Default
Section titled “Default”false
-
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.
Default
Section titled “Default”'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.
Default
Section titled “Default”'floating'
-
altBoundary?:boolean -
Whether to check the alternate elementContext's boundary. Please see https://floating-ui.com/docs/detectoverflow#altboundary for more information.
Default
Section titled “Default”false
AutocompleteRootProps
Section titled “AutocompleteRootProps”Props for the AutocompleteRoot React component.
Properties
Section titled “Properties”-
The regular expression to match the query text to autocomplete.
Default
Section titled “Default”null
-
filter?:ItemFilter|null -
The filter function to determine if an item should be shown in the listbox.
Default
Section titled “Default”defaultItemFilter
-
onOpenChange?: (event:OpenChangeEvent) =>void -
Fired when the open state changes.
-
onQueryChange?: (event:QueryChangeEvent) =>void -
Fired when the query changes.
-
onValueChange?: (event:ValueChangeEvent) =>void -
Emitted when the selected value changes. Only available when multiple is false.
-
onValuesChange?: (event:ValuesChangeEvent) =>void -
Emitted when the selected values change. Only available when multiple is true.
Variables
Section titled “Variables”AutocompleteEmpty
Section titled “AutocompleteEmpty”-
const AutocompleteEmpty:ForwardRefExoticComponent<AutocompleteEmptyProps&HTMLAttributes<AutocompleteEmptyElement> &RefAttributes<AutocompleteEmptyElement>> -
A React component that renders an
prosekit-autocomplete-emptycustom element.
AutocompleteItem
Section titled “AutocompleteItem”-
const AutocompleteItem:ForwardRefExoticComponent<AutocompleteItemProps&Omit<HTMLAttributes<AutocompleteItemElement>,"onSelect"> &RefAttributes<AutocompleteItemElement>> -
A React component that renders an
prosekit-autocomplete-itemcustom element.
AutocompletePopup
Section titled “AutocompletePopup”-
const AutocompletePopup:ForwardRefExoticComponent<AutocompletePopupProps&HTMLAttributes<AutocompletePopupElement> &RefAttributes<AutocompletePopupElement>> -
A React component that renders an
prosekit-autocomplete-popupcustom element.
AutocompletePositioner
Section titled “AutocompletePositioner”-
const AutocompletePositioner:ForwardRefExoticComponent<AutocompletePositionerProps&HTMLAttributes<AutocompletePositionerElement> &RefAttributes<AutocompletePositionerElement>> -
A React component that renders an
prosekit-autocomplete-positionercustom element.
AutocompleteRoot
Section titled “AutocompleteRoot”-
const AutocompleteRoot:ForwardRefExoticComponent<AutocompleteRootProps&HTMLAttributes<AutocompleteRootElement> &RefAttributes<AutocompleteRootElement>> -
A React component that renders an
prosekit-autocomplete-rootcustom element.