@hypothesis/frontend-shared
Version:
Shared components, styles and utilities for Hypothesis projects
15 lines (14 loc) • 578 B
TypeScript
import type { RefObject } from 'preact';
export type UseTabKeyNavigationOptions = {
/**
* Don't respond to any keyboard events if not enabled. This allows selective
* enabling by components using this hook, as hook use itself cannot be
* conditional.
*/
enabled?: boolean;
/**
* CSS selector which specifies which elements should be in the tab sequence
*/
selector?: string;
};
export declare function useTabKeyNavigation(containerRef: RefObject<HTMLElement | undefined>, { enabled, selector, }?: UseTabKeyNavigationOptions): void;