@react-aria/focus

  • Version 3.5.5
  • Published
  • 218 kB
  • 5 dependencies
  • Apache-2.0 license

Install

npm i @react-aria/focus
yarn add @react-aria/focus
pnpm add @react-aria/focus

Overview

Spectrum UI components in React

Index

Functions

function focusSafely

focusSafely: (element: HTMLElement) => void;
  • A utility function that focuses an element while avoiding undesired side effects such as page scrolling and screen reader issues with CSS transitions.

function useFocusRing

useFocusRing: (props?: FocusRingProps) => FocusRingAria;
  • Determines whether a focus ring should be shown to indicate keyboard focus. Focus rings are visible only when the user is interacting with a keyboard, not with a mouse, touch, or other input methods.

Package Files (3)

Dependencies (5)

Dev Dependencies (0)

No dev dependencies.

Peer Dependencies (1)

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@react-aria/focus.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@react-aria/focus)
  • HTML
    <a href="https://www.jsdocs.io/package/@react-aria/focus"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>