useDisclosable
The useDisclosable hook is the primary way to interact with the disclosable system.
API
open
Opens a disclosable component and returns a Promise that resolves when the dialog is closed.
Parameters
Options
Return Value
Returns a Promise<string | undefined> that:
- Resolves with the
closeReasonpassed tocloseDisclosable()when the dialog closes - Resolves with
undefinedif closed without a reason - Resolves with
undefinedif a dialog with the same identifier is already open (whenreplace: false)
Usage
With Custom Identifier
close
Closes a specific disclosable by component or identifier.
Parameters
Options
Usage
closeAll
Closes all currently open disclosables.
Parameters
Usage
setProps
Updates the props of an already-open disclosable.
Parameters
Usage
disclosables
An object containing all currently open disclosables. Useful for debugging or building custom UI.
