LiveRegionControls
interfaceSource L15Type contract for LiveRegionControls.
interface LiveRegionControlsMembers
| Name | Type |
|---|---|
announce | (message: string) => void |
clear | () => void |
supported | boolean |
Open-code aq-ui React hook for Use Live Region.
pnpm dlx aq-ui@alpha add use-live-regionImport the parts you need, then jump to an export for its contract.
"use client"
import { useLiveRegion } from "@/hooks/use-live-region"
const result = useLiveRegion()Type contract for LiveRegionControls.
interface LiveRegionControls| Name | Type |
|---|---|
announce | (message: string) => void |
clear | () => void |
supported | boolean |
Type contract for LiveRegionPoliteness.
type LiveRegionPoliteness = "polite" | "assertive"Open-code aq-ui React hook for Use Live Region.
function useLiveRegion({ politeness = "polite", clearAfter = 7_000, }: UseLiveRegionOptions = {}): LiveRegionControlsLiveRegionControls| Name | Type | Default |
|---|---|---|
options? | UseLiveRegionOptions | {} |
Type contract for UseLiveRegionOptions.
interface UseLiveRegionOptions| Name | Type | Default |
|---|---|---|
politeness? | LiveRegionPoliteness | "polite" |
clearAfter? | number | 7_000 |
use-hydrated, use-stable-callback