The dcc.Location component represents the location or address bar in your web
browser. Through its href, pathname, search and hash properties
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

Location Properties

Access this documentation in your Python terminal with:


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
Dash Enterprise

id (string; 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
an app.

pathname (string; optional):
pathname in window.location - e.g., “/my/full/pathname”.

search (string; optional):
search in window.location - e.g., “?myargument=1”.

hash (string; optional):
hash in window.location - e.g., “#myhash”.

href (string; optional):
href in window.location - e.g.,

refresh (boolean; default True):
Refresh the page when the location is updated?.