Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ function MyApp() {
}
```

### Custom Stores

You can create custom global stores outside components by instantiating `Store` and passing it to the `useControls` hook:

```jsx
import { useControls, Store } from 'leva'

const store = new Store()

const Example = () => {
const values = useControls({ x: 0 }, { store })

return values.x
}
```

### Disabling the GUI

Each instance of the `useControls` hook will render the panel. If you want to completely disable the GUI based on preferences, you need to explicitly set `hidden` to false.
Expand Down
2 changes: 1 addition & 1 deletion packages/leva/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export { useStoreContext, LevaStoreProvider } from './context'

// export the levaStore (default store)
// hook to create custom store
export { levaStore, useCreateStore } from './store'
export { levaStore, useCreateStore, Store } from './store'

// export folder, monitor, button
export * from './helpers'
Expand Down