@accessible/visually-hidden 中文文档教程
<VisuallyHidden>
npm i @accessible/visually-hidden
用于向元素添加视觉隐藏样式的 React 组件
Quick Start
只需包装一个接受 style
属性的子元素,该组件就会添加视觉隐藏样式 在不覆盖子项上已经存在的样式的情况下为其添加样式。
```jsx和谐 // VisuallyHidden 是组件 // visuallyHidden 是一个样式对象 从 '@accessible/visually-hidden' 导入 {VisuallyHidden, visuallyHidden}
export default (props) => ( <视觉隐藏> ) // ```
LICENSE
麻省理工学院
<VisuallyHidden>
npm i @accessible/visually-hidden
A React component for adding visually hidden styles to elements
Quick Start
Simply wrap a child element that accepts a style
prop and this component will add visually hidden styles to it without overwriting styles already present on the child.
```jsx harmony // VisuallyHidden is the component // visuallyHidden is a style object import {VisuallyHidden, visuallyHidden} from '@accessible/visually-hidden'
export default (props) => (
LICENSE
MIT