@agnos-ui/core
Version:
Framework-agnostic headless component library.
10 lines (9 loc) • 388 B
TypeScript
import type { Directive } from '../types';
/**
* Directive to focus an element and manage focus stack.
* When the element is destroyed, focus returns to the previous focusable element in the stack.
*
* @param element - The HTML element to focus.
* @returns An object with a destroy method to remove the element from the focus stack.
*/
export declare const focusElement: Directive;