@accessible/using-keyboard 中文文档教程
<UsingKeyboard>
npm i @accessible/using-keyboard
React 实用程序,用于在有人使用键盘导航时向元素添加可访问的焦点样式。
Quick Start
```jsx和谐 进口 { 使用键盘, 身体使用键盘, 使用键盘, } 来自 '@accessibile/using-keyboard'
const App = (props) => (
API
useUsingKeyboard(defaultUsingKeyboard)
一个 React 钩子,当键盘比鼠标最近被使用时返回 true
聚焦一个元素。
Arguments
Argument | Type | Required | Default | Description |
---|---|---|---|---|
defaultUsingKeyboard | boolean | false | false | Sets the default value of usingKeyboard |
Returns boolean
<BodyUsingKeyboard>
一个 React 组件,在最近使用键盘时将 using-keyboard
类添加到 比鼠标聚焦元素。 每次触发
mousedown
事件时,它都会删除该类。
Prop | Type | Required | Default | Description |
---|---|---|---|---|
className | string | false | "using-keyboard" | This is the class name that gets appended to the body |
defaultUsingKeyboard | boolean | false | false | Sets the default value of usingKeyboard |
children | React.ReactElement | false | undefined | By default this renders no children, but it will render any children you provide here. |
<UsingKeyboard>
一个 React 组件,在最近使用键盘时将 using-keyboard
类添加到其子元素 比鼠标聚焦元素。 每次触发 mousedown
事件时,它都会删除该类。
Prop | Type | Required | Default | Description |
---|---|---|---|---|
className | string | false | "using-keyboard" | This is the class name that gets appended to the child element |
defaultUsingKeyboard | boolean | false | false | Sets the default value of usingKeyboard |
children | React.ReactElement | false | undefined | By default this renders no children, but it will render any children you provide here. |
LICENSE
麻省理工学院
<UsingKeyboard>
npm i @accessible/using-keyboard
React utilities for adding accessible focus styles to elements when someone is using keyboard navigation.
Quick Start
```jsx harmony import { UsingKeyboard, BodyUsingKeyboard, useUsingKeyboard, } from '@accessibile/using-keyboard'
const App = (props) => (
API
useUsingKeyboard(defaultUsingKeyboard)
A React hook that returns true
when the keyboard was used more recently than the mouse for focusing an element.
Arguments
Argument | Type | Required | Default | Description |
---|---|---|---|---|
defaultUsingKeyboard | boolean | false | false | Sets the default value of usingKeyboard |
Returns boolean
<BodyUsingKeyboard>
A React component that adds a using-keyboard
class to the <body>
when the keyboard was used more recently than the mouse for focusing an element. It removes the class each time a mousedown
event fires.
Prop | Type | Required | Default | Description |
---|---|---|---|---|
className | string | false | "using-keyboard" | This is the class name that gets appended to the body |
defaultUsingKeyboard | boolean | false | false | Sets the default value of usingKeyboard |
children | React.ReactElement | false | undefined | By default this renders no children, but it will render any children you provide here. |
<UsingKeyboard>
A React component that adds a using-keyboard
class to its child element when the keyboard was used more recently than the mouse for focusing an element. It removes the class each time a mousedown
event fires.
Prop | Type | Required | Default | Description |
---|---|---|---|---|
className | string | false | "using-keyboard" | This is the class name that gets appended to the child element |
defaultUsingKeyboard | boolean | false | false | Sets the default value of usingKeyboard |
children | React.ReactElement | false | undefined | By default this renders no children, but it will render any children you provide here. |
LICENSE
MIT
你可能也喜欢
- 3box-comments-react 中文文档教程
- 3box-react-hooks 中文文档教程
- 3cma 中文文档教程
- @11ty/eleventy-plugin-inclusive-language 中文文档教程
- @2dfire--fe/component-library 中文文档教程
- @3beeepb/react-native-keyboard-dismiss 中文文档教程
- @3yourmind/sass-node-modules-importer 中文文档教程
- @4geit/swg-create-or-load-data-helper 中文文档教程
- @_immo/return 中文文档教程
- @a-la/styles 中文文档教程