dccLocation component represents the location or address bar in your web
browser. Through its
you can access different portions of the URL that the app is loaded on.
See the URLs & Multipage Apps chapter for more details.
For example, given the URL
Our recommended IDE for writing Dash apps is Dash Enterprise’s
Data Science Workspaces,
which has typeahead support for Dash Component Properties.
Find out if your company is using
id (character; required):
The ID of this component, used to identify dash components in
callbacks. The ID needs to be unique across all of the components in
pathname (character; optional):
pathname in window.location - e.g., “/my/full/pathname”.
search (character; optional):
search in window.location - e.g., “?myargument=1”.
hash (character; optional):
hash in window.location - e.g., “#myhash”.
href (character; optional):
href in window.location - e.g.,
refresh (a value equal to: ‘callback-nav’ | logical; default
True to navigate outside the Dash app or to manually refresh a
False if the same callback that updates the Location
component is also updating the page content - typically used in
multi-page apps that do not use Pages. Use ‘callback-nav’ if you are
updating the URL in a callback, or a different callback will respond
to the new Location with updated content. This is typical with
multi-page apps that use Pages. This will allow for navigating to a
new page without refreshing the page.