The dcc.Store
component is used to store JSON data in the browser.
For more information and examples, refer to Part 4 of the Dash tutorial on Sharing Data Between Callbacks.
If you use the data
prop as an output, you cannot get the
initial data on load with the data
prop. To counter this,
you can use the modified_timestamp
as Input
and the data
as State
.
modified_timestamp
is read only.Access this documentation in your Python terminal with:
```pythonhelp(dash.dcc.Store)
```
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.
storage_type
(a value equal to: ‘local’, ‘session’ or ‘memory’; default 'memory'
):
The type of the web storage. memory: only kept in memory, reset on
page refresh. local: window.localStorage, data is kept after the
browser quit. session: window.sessionStorage, data is cleared once the
browser quit.
data
(dict | list | number | string | boolean; optional):
The stored data for the id.
clear_data
(boolean; default False
):
Set to True to remove the data contained in data_key
.
modified_timestamp
(number; default -1
):
The last time the storage was modified.