--- title: useLocalStorage description: "`useLocalStorage` is a custom hook for storing, updating, and retrieving values in local storage." links: - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/hooks/use-local-storage - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/hooks-uselocalstorage--basic --- ```tsx const [value, setValue, resetValue] = useLocalStorage({ key: "value", defaultValue: 1, }) return ( ) ``` ## Usage ```tsx import { useLocalStorage } from "@yamada-ui/react" ``` ```tsx import { useLocalStorage } from "@/components/ui" ``` ```tsx import { useLocalStorage } from "@workspaces/ui" ``` ```tsx const [value, setValue, resetValue] = useLocalStorage({ key: "value", defaultValue: 1, }) ```