use_query_params
use_query_params is a hook that returns all URL query parameters as a dictionary. Keys are parameter names and values are list[str].
Note
Deephaven and all custom components share query parameters. Avoid using query parameters in shared components to prevent conflicts. Deephaven reserves the following parameters for internal use:
envoyPrefixauthProvidernamepskthemepreloadTransparentThemeisSamlRedirectalgorithmencodedStr- Any parameter starting with
_ordh
Example
Navigating to a URL with a query string such as ?sym=DOG&sym=CAT&side=buy will display the table pre-filtered to only show rows where Sym is DOG or CAT and Side is buy.
Recommendations
- Multiple parameter access: Use
use_query_paramswhen you need access to all query parameters or custom parsing logic. - Single parameter access: If you only need a single parameter, consider
use_query_paramfor a more concise API. - Validate parameters before use: Parameters can be manipulated by the user and may not be in the format you expect.
API reference
deephaven.ui.use_query_params()
Returns the current URL query parameters as a dictionary.
- Return type:
Dict[str,List[str]] - Returns: A dictionary mapping parameter names to lists of string values.