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:

  • envoyPrefix
  • authProvider
  • name
  • psk
  • theme
  • preloadTransparentTheme
  • isSamlRedirect
  • algorithm
  • encodedStr
  • Any parameter starting with _ or dh

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

  1. Multiple parameter access: Use use_query_params when you need access to all query parameters or custom parsing logic.
  2. Single parameter access: If you only need a single parameter, consider use_query_param for a more concise API.
  3. 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.