@drawerly/react / UseDrawerlyResult
UseDrawerlyResult<TDrawerOptions>
Returned by useDrawerly.
Extends
Drawerly<TDrawerOptions>
Type Parameters
TDrawerOptions
TDrawerOptions extends ReactDrawerOptions = ReactDrawerOptions
Properties
bringToTop()
bringToTop: (key) => void;Moves the drawer with the given key to the top of the stack.
Parameters
key
string
Returns
void
Inherited from
Drawerly.bringToTopclose()
close: (key?) => void;Closes the top drawer or the drawer with the given key.
Parameters
key?
string
Returns
void
Inherited from
Drawerly.closecloseAll()
closeAll: () => void;Closes all drawers.
Returns
void
Inherited from
Drawerly.closeAllgetDefaultOptions()
getDefaultOptions: () => DrawerDefaultOptions<TDrawerOptions>;Returns the current global default options.
Returns
DrawerDefaultOptions<TDrawerOptions>
Inherited from
Drawerly.getDefaultOptionsgetDrawerInstance()
getDrawerInstance: (key) => TDrawerOptions | undefined;Returns a drawer instance by key, if it exists.
Parameters
key
string
Returns
TDrawerOptions | undefined
Inherited from
Drawerly.getDrawerInstancegetState()
getState: () => DrawerState<TDrawerOptions>;Returns the current drawer state.
Returns
DrawerState<TDrawerOptions>
Inherited from
Drawerly.getStategetTopDrawer()
getTopDrawer: () => TDrawerOptions | undefined;Returns the topmost drawer instance, if any.
Returns
TDrawerOptions | undefined
Inherited from
Drawerly.getTopDrawerisOpen()
isOpen: (key) => boolean;Returns whether a drawer with the given key is in the stack.
Parameters
key
string
Returns
boolean
Inherited from
Drawerly.isOpenopen()
open: (options) => string;Opens a drawer at the top of the stack. Options of an already open drawer are replaced.
Parameters
options
TDrawerOptions
Returns
string
Inherited from
Drawerly.openstack
stack: readonly TDrawerOptions[];Current drawer stack. The last item is the topmost drawer.
subscribe()
subscribe: (listener) => Unsubscribe;Subscribes to state changes.
Parameters
listener
DrawerListener<TDrawerOptions>
Returns
Inherited from
Drawerly.subscribeupdateDefaultOptions()
updateDefaultOptions: (patch) => void;Merges a patch into the global default options used for future drawers.
Parameters
patch
DrawerDefaultOptions<TDrawerOptions>
Returns
void
Inherited from
Drawerly.updateDefaultOptionsupdateOptions()
updateOptions: (key, patch) => void;Merges a patch into the options of an existing drawer.
Parameters
key
string
patch
DrawerPatch<TDrawerOptions>
Returns
void
Inherited from
Drawerly.updateOptions