useTheme

A hook for managing and accessing theme-related states and actions.

Example

An example showcasing how to use the useTheme hook to toggle modes, change directions, and adjust layout settings.
returnDescriptionTypeDefault
setSchemaUpdates the current theme schema and applies the new schema.(schema: string) => void-
setModeSets the theme mode (e.g., light or dark) and applies it to the document.(mode: Mode) => void-
setSideNavCollapseToggles the collapse state of the side navigation.(sideNavCollapse: boolean) => void-
setDirectionSets the text direction of the document (e.g., ltr or rtl).(direction: Direction) => void-
setPanelExpandExpands or collapses a panel based on the provided value.(panelExpand: boolean) => void-
setLayoutSets the layout type of the application (e.g., vertical, horizontal).(layout: LayoutType) => void-
modeThe current theme mode (e.g., light or dark).Mode-
directionThe current text direction (e.g., ltr or rtl).Direction-
layoutThe current layout type of the application.LayoutType-