Creates a focus scope inside a container element and returns controls to move focus around.
A ref to a container element inside which focus state is managed.
Focus scope props.
Focus controls that allow to move focus around in a container element. An object which identity never changes between renders.
const containerRef = useRef(null);const focusControls = useFocusScope(containerRef);<FocusControlsProvider value={focusControls}> <div ref={containerRef}> <input/> </div></FocusControlsProvider> Copy
const containerRef = useRef(null);const focusControls = useFocusScope(containerRef);<FocusControlsProvider value={focusControls}> <div ref={containerRef}> <input/> </div></FocusControlsProvider>
Creates a focus scope inside a container element and returns controls to move focus around.