| 16 | import styles from '@react-spectrum/docs/src/docs.css'; |
| 17 | |
| 18 | export function ExampleList({tag, style}) { |
| 19 | let {pages} = React.useContext(PageContext); |
| 20 | let examples = pages |
| 21 | .filter( |
| 22 | page => |
| 23 | page.name.startsWith('react-aria/examples/') && |
| 24 | !page.name.endsWith('index.html') && |
| 25 | (!tag || page.keywords.includes(tag)) |
| 26 | ) |
| 27 | .sort((a, b) => a.title.localeCompare(b.title)); |
| 28 | |
| 29 | return ( |
| 30 | <section className={styles.cardGroup} data-size="small" style={style}> |
| 31 | {examples.map(page => ( |
| 32 | <ExampleCard |
| 33 | key={page.name} |
| 34 | url={page.url} |
| 35 | preview={page.image} |
| 36 | title={page.title} |
| 37 | description={page.description} |
| 38 | cover |
| 39 | /> |
| 40 | ))} |
| 41 | </section> |
| 42 | ); |
| 43 | } |