PaceUI

Blocks
MCPComponentsTemplatesChartsStarter
Native AI
Introduction
Components
Browser SupportResponse RendererChat HeaderChat MessagesChat SuggestionsChat Input
Use Cases
Quick ChatFollow Ups
Hooks
useBrowserSupportuseNativeAI

Browser Support

PreviousNext

React hook to detect client-side Chrome Built-in AI support, identify browser type, and manage availability state.

Overview

The useBrowserSupport hook queries the browser to check whether Chrome Built-in AI (window.ai / LanguageModel) is available natively. It identifies the client's browser, provides helpful error reasons if unsupported, and offers a recheck method to dynamically update support status without a full page reload.

Installation

NPM
pnpm
Yarn
Bun
npm install npx shadcn@latest add @paceui/native-ai-use-browser-support

Usage

Here is a basic example of checking browser AI support and displaying status badges or fallback alerts:

SupportCheck.tsx
import { useBrowserSupport } from "@/hooks/native-ai/use-browser-support";export function SupportCheck() {  const { isSupported, isLoading, detectedBrowser, errorReason, recheck } = useBrowserSupport();  if (isLoading) {      return <div>Checking browser AI support...</div>;  }  return (      <div className="p-4 border rounded-md">          <p><strong>Browser:</strong> {detectedBrowser}</p>          <p><strong>Status:</strong> {isSupported ? "Supported" : "Unsupported"}</p>          {errorReason && <p className="text-red-500">{errorReason}</p>}          <button onClick={recheck} className="mt-2 px-3 py-1 border rounded">              Re-check Support          </button>      </div>  );}

API Reference

Returns

PropertyTypeDescription
isLoadingbooleantrue while the hook is actively querying browser capabilities.
isSupportedbooleantrue if native Chrome Built-in AI (window.ai) is available on the client.
isMobilebooleantrue if client is a mobile device (mobile devices are not supported yet).
engine"chrome-native" | nullThe active AI engine type, or null if unsupported.
errorReasonstring | undefinedDescriptive reason explaining why local AI support is currently unavailable.
detectedBrowserBrowserTypeDetected browser identifier ("chrome" | "firefox" | "edge" | "safari").
canEnablebooleantrue if the detected browser supports enabling native AI flags (e.g. Chrome).
recheck() => Promise<void>Function to trigger a manual re-evaluation of browser AI support.

Exported Helpers & Types

helpersAndTypes.ts
export type BrowserType = "chrome" | "firefox" | "edge" | "safari";export type AIEngine = "chrome-native" | "polyfill-webllm";export const SUPPORTED_NATIVE_BROWSERS: BrowserType[] = ["chrome"];export function detectMobile(): boolean;export function detectBrowser(): BrowserType;
Follow UpsuseNativeAI

PaceUI

The ultimate toolkit empowering your designers and developers to launch their next big idea without ever settling on quality

Pages

ComponentsBlocksMCPTemplatesStarter

Account

ManageLicensesPricing

Support

AffiliateContact UsPrivacy PolicyTerms of ServiceDocs

© 2026 PaceUI. All rights reserved. Built by indie developer, Denish

PACEUI