leafyGreen UI Kit A11y
npm install @leafygreen-ui/a11y``shell`
pnpm add @leafygreen-ui/a11y
`shell`
yarn add @leafygreen-ui/a11y
`shell`
npm install @leafygreen-ui/a11y
`js
import { VisuallyHidden } from '@leafygreen-ui/a11y';
const Button = () => {
return (
);
};
`
| Prop | Type | Description | Default |
| ---------- | -------- | ----------------------------------------------------------------------- | ------- |
| children | string | Text that is announced to screen readers but is hidden from the screen. | |
Hook that returns two sets of props that accessibly associate a label and its respective input element
| Parameter | Type | Description | Default |
| --------- | -------- | ------------------------------------ | ------- |
| id | string | id that describes the input element. | |
Function that validates that either aria-label or aria-labelledby are present within props.
| Parameter | Type | Description | Default |
| --------------- | --------------------- | --------------------------------------------- | ------- |
| props | Record | Object of component properties. | |componentName
| | string | Name of component with props to be validated. | |
Returns an emotion CSS instance for rendering styles that respect
OS-level preferences for reduced motion.
Use this function to remove scale, size, and positional transitions
for users with that preference set.
| Parameter | Type | Description | Default |
| --------- | -------- | --------------------------------------------------------- | ------- |
| styles | string` | String of styles to render within preference media query. | |