Skip to content
EliteChart

useUIStore

Documentation


Documentation / @elitechart/elitechart / useUIStore

code
const useUIStore: UseBoundStore<WithPersist<StoreApi<UIState>, unknown>>;

Defined in: elitechart/src/lib/store/useUIStore.ts:139

UI-shell zustand store — sidebar panel, bottom tab, modal, active drawing tool, theme mode. Persisted in localStorage as elitechart-ui (see partialize for the kept fields).

Example

code
import { useUIStore } from '@elitechart/elitechart';

function MySidebarToggle() {
  const panel = useUIStore((s) => s.activeSidebarPanel);
  const setPanel = useUIStore((s) => s.setSidebarPanel);
  return (
    <button onClick={() => setPanel(panel === 'watchlist' ? null : 'watchlist')}>
      Watchlist
    </button>
  );
}