Skip to content
Components

Hooks

Use framework hooks when React needs to know about the environment or an interaction. Prefer style props for visual changes that do not need application logic.

Read the current theme

useTheme() exposes themeMode, setThemeMode, theme, and color helpers. The provider accepts mode; the hook's state is named themeMode.

INTERACTIVE EXAMPLE

Loading preview…

Components resolve color tokens automatically. Use getColor for a CSS value or getColorHex when an external tool requires a literal color. See Colors & theming.

Respond to device state

useResponsive() reads the configuration from ResponsiveProvider. Use on('mobile') for device-aware logic. A hook-driven decision re-renders when its state changes; use the media prop for purely visual overrides.

INTERACTIVE EXAMPLE

Loading preview…

Avoid removing essential content just because a viewport is smaller. See Responsive layouts.

Track hover for a visual detail

INTERACTIVE EXAMPLE

Loading preview…

Hover is a browser interaction, not a native touch interaction. Keep actions and information available to keyboard, touch, and assistive-technology users.

Read window dimensions

Wrap consumers of useWindowSize() in WindowSizeProvider:

INTERACTIVE EXAMPLE

Loading preview…

Window dimensions describe the window, not necessarily a component's available width. On native, verify rotation and split-screen behavior on the target platform.

Further hooks

The framework also exposes hooks for focus, visibility, scrolling, and element position. Consult the hook reference and current TypeScript signatures for their options and platform differences.

Browse documentation source