mcp-use TypeScript API
    Preparing search index...

    Function useViewTheme

    • Subscribe to the host color theme only.

      Returns "light" | "dark"

      Returns the same value as useHostContext's theme and updates live when the user or host switches themes. Prefer this hook when theme is all a component needs: it re-renders only when the resolved theme string changes, never on locale, dimensions, display mode, or tool updates. Returns "light" until the host reports a theme.

      const theme = useViewTheme();