Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zendeskgarden/container-keyboardfocus

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zendeskgarden/container-keyboardfocus

Containers relating to keyboard focus in the Garden Design System

  • 1.0.14
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@zendeskgarden/container-keyboardfocus npm version

This package includes containers relating to keyboardfocus in the Garden Design System.

Installation

npm install @zendeskgarden/container-keyboardfocus

Usage

Check out storybook for live examples.

useKeyboardFocus

The useKeyboardFocus hook supplies state and props that help you to distinguish between mouse and keyboard focus.

import { useKeyboardFocus } from '@zendeskgarden/container-keyboardfocus';

const KeyboardFocus = () => {
  const { getFocusProps, keyboardFocused } = useKeyboardFocus();

  return (
    <div {...getFocusProps()}>{keyboardFocused ? 'Keyboard focused!' : 'Not keyboard focused'}</div>
  );
};

KeyboardFocusContainer

KeyboardFocsuContainer is a render-prop wrapper for the useKeyboardFocus hook.

import { KeyoardFocusContainer } from '@zendeskgarden/container-keyboardfocus';

<KeyboardFocusContainer>
  {({ keyboardFocused, getFocusProps }) => (
    <div {...getFocusProps()}>{keyboardFocused ? 'Keyboard focused!' : 'Not keyboard focused'}</div>
  )}
</KeyboardFocusContainer>;

Keywords

FAQs

Package last updated on 26 Jan 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc