@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
你可能也喜欢
- 3dwayfinder-angular 中文文档教程
- 98k-loading 中文文档教程
- @01js/compressing 中文文档教程
- @0y0/eslint-plugin-react 中文文档教程
- @a.gusev/symlink-webpack-plugin 中文文档教程
- @a2670392079/data-structure-ts 中文文档教程
- @abtasty/before-after-image 中文文档教程
- @achavarriafh/create-npm-package 中文文档教程
- @ackee/react-scripts-browser-extension 中文文档教程
- @ackuikui/kui 中文文档教程