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.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 | Array | Real | String | Bool; optional):
The stored data for the id.
clear_data
(Bool; default false
):
Set to true to remove the data contained in data_key
.
modified_timestamp
(Real; default -1
):
The last time the storage was modified.