Socket
Book a DemoInstallSign in
Socket

@radix-ui/react-roving-focus

Package Overview
Dependencies
Maintainers
6
Versions
264
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-roving-focus

This is an internal utility, not intended for public usage.

1.1.4-rc.1744416976900
Source
npmnpm
Version published
Weekly downloads
10M
-21.22%
Maintainers
6
Weekly downloads
 
Created

What is @radix-ui/react-roving-focus?

@radix-ui/react-roving-focus is a React component library that provides a set of utilities for managing focus within a group of elements. It is particularly useful for creating accessible, keyboard-navigable interfaces where focus needs to be managed in a predictable and controlled manner.

What are @radix-ui/react-roving-focus's main functionalities?

Roving Focus Group

This feature allows you to create a group of elements where focus can be moved using keyboard navigation. The `RovingFocusGroup` component wraps the group, and each focusable item is wrapped with `RovingFocusItem`.

import { RovingFocusGroup, RovingFocusItem } from '@radix-ui/react-roving-focus';

function Example() {
  return (
    <RovingFocusGroup>
      <RovingFocusItem asChild>
        <button>Item 1</button>
      </RovingFocusItem>
      <RovingFocusItem asChild>
        <button>Item 2</button>
      </RovingFocusItem>
      <RovingFocusItem asChild>
        <button>Item 3</button>
      </RovingFocusItem>
    </RovingFocusGroup>
  );
}

Custom Focus Management

This feature allows you to customize the focus management by specifying the orientation (horizontal or vertical) of the focus group. This is useful for creating more complex navigation patterns.

import { RovingFocusGroup, RovingFocusItem } from '@radix-ui/react-roving-focus';

function CustomFocusExample() {
  return (
    <RovingFocusGroup orientation="horizontal">
      <RovingFocusItem asChild>
        <button>Left</button>
      </RovingFocusItem>
      <RovingFocusItem asChild>
        <button>Center</button>
      </RovingFocusItem>
      <RovingFocusItem asChild>
        <button>Right</button>
      </RovingFocusItem>
    </RovingFocusGroup>
  );
}

Other packages similar to @radix-ui/react-roving-focus

FAQs

Package last updated on 12 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.