aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
50 lines • 1.44 kB
TypeScript
import React from 'react';
export interface FocusTrapProps {
children: React.ReactNode;
/**
* Whether the focus trap is active
*/
active?: boolean;
/**
* Whether to restore focus when trap is deactivated
*/
restoreFocus?: boolean;
/**
* Whether to focus the first element when trap is activated
*/
autoFocus?: boolean;
/**
* Whether to allow escape key to deactivate trap
*/
allowEscape?: boolean;
/**
* Callback when escape is pressed
*/
onEscape?: () => void;
/**
* Elements to exclude from focus trap
*/
exclude?: string[];
/**
* Whether to lock scroll when trap is active
*/
lockScroll?: boolean;
/**
* Custom selector for focusable elements
*/
focusableSelector?: string;
}
/**
* FocusTrap component
* Traps focus within a container for accessibility
*/
export declare function FocusTrap({ children, active, restoreFocus, autoFocus, allowEscape, onEscape, exclude, lockScroll, focusableSelector, }: FocusTrapProps): import("react/jsx-runtime").JSX.Element;
/**
* Hook to create a focus trap programmatically
*/
export declare function useFocusTrap(containerRef: React.RefObject<HTMLElement>, options?: Omit<FocusTrapProps, 'children'>): {
focusFirst: () => void;
focusLast: () => void;
getFocusableElements: () => HTMLElement[];
};
//# sourceMappingURL=FocusTrap.d.ts.map