@primer/components
Version:
Primer react components
24 lines (23 loc) • 1.06 kB
TypeScript
import React from 'react';
import { FocusZoneSettings } from '../behaviors/focusZone';
export interface FocusZoneHookSettings extends Omit<FocusZoneSettings, 'activeDescendantControl'> {
/**
* Optional ref for the container that holds all elements participating in arrow key focus.
* If one is not passed, we will create one for you and return it from the hook.
*/
containerRef?: React.RefObject<HTMLElement>;
/**
* If using the "active descendant" focus pattern, pass `true` or a ref to the controlling
* element. If a ref object is not passed, we will create one for you.
*/
activeDescendantFocus?: boolean | React.RefObject<HTMLElement>;
/**
* Set to true to disable the focus zone and clean up listeners. Can be re-enabled at
* any time.
*/
disabled?: boolean;
}
export declare function useFocusZone(settings?: FocusZoneHookSettings, dependencies?: React.DependencyList): {
containerRef: React.RefObject<HTMLElement>;
activeDescendantControlRef: React.RefObject<HTMLElement>;
};