Skip to content

Instantly share code, notes, and snippets.

@luismartinezs
Last active August 30, 2022 10:39
Show Gist options
  • Save luismartinezs/422e7d2c424d8f65a4923e662a788b79 to your computer and use it in GitHub Desktop.
Save luismartinezs/422e7d2c424d8f65a4923e662a788b79 to your computer and use it in GitHub Desktop.
A11y React components #a11y #react
// https://reactjs.org/docs/accessibility.html
import React from 'react';
function ListItem({ item }) {
return (
// https://reactjs.org/docs/fragments.html
<>
<dt>{item.term}</dt>
<dd>{item.description}</dd>
</>
);
}
function Glossary(props) {
return (
<dl>
{props.items.map(item => (
<ListItem item={item} key={item.id} />
))}
</dl>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment