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

Function ExampleList

packages/dev/s2-docs/src/ExampleList.tsx:28–89  ·  view source on GitHub ↗
({tag, pages})

Source from the content-addressed store, hash-verified

26};
27
28export function ExampleList({tag, pages}) {
29 let examples = pages
30 .filter(
31 page =>
32 page.name.startsWith('react-aria/examples/') &&
33 !page.name.endsWith('index') &&
34 (!tag || page.exports?.keywords.includes(tag))
35 )
36 .sort((a, b) => getTitle(a).localeCompare(getTitle(b)));
37
38 return (
39 <ul
40 itemScope
41 itemType="https://schema.org/ItemList"
42 className={style({
43 display: 'grid',
44 gridTemplateColumns: `repeat(auto-fit, ${size(240)})`,
45 gap: 24,
46 marginTop: 32,
47 padding: 0,
48 listStyleType: 'none',
49 justifyContent: {
50 default: 'center',
51 lg: 'start'
52 }
53 })}>
54 <meta itemProp="name" content="Examples" />
55 <ImageCoordinator>
56 {examples.map(example => (
57 <li
58 key={example.url}
59 itemProp="itemListElement"
60 itemScope
61 itemType="https://schema.org/ListItem">
62 <div
63 className={style({display: 'contents'})}
64 itemProp="item"
65 itemScope
66 itemType="https://schema.org/TechArticle">
67 <meta itemProp="url" content={example.url} />
68 <Card href={example.url}>
69 <CardPreview>
70 <ExampleImage name={example.name} itemProp="image" />
71 </CardPreview>
72 <Content>
73 <Text slot="title" itemProp="headline">
74 {getTitle(example)}
75 </Text>
76 {example.exports?.description ? (
77 <Text slot="description" itemProp="description">
78 {example.exports?.description}
79 </Text>
80 ) : null}
81 </Content>
82 </Card>
83 </div>
84 </li>
85 ))}

Callers

nothing calls this directly

Calls 4

sizeFunction · 0.90
getTitleFunction · 0.70
sortMethod · 0.65
filterMethod · 0.65

Tested by

no test coverage detected