MCPcopy Create free account
hub / github.com/adobe/react-spectrum / ExampleList

Function ExampleList

packages/dev/docs/src/ExampleList.js:18–43  ·  view source on GitHub ↗
({tag, style})

Source from the content-addressed store, hash-verified

16import styles from '@react-spectrum/docs/src/docs.css';
17
18export 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}

Callers

nothing calls this directly

Calls 2

sortMethod · 0.65
filterMethod · 0.65

Tested by

no test coverage detected