MCPcopy Create free account
hub / github.com/github/docs / ArticleCard

Function ArticleCard

components/guides/ArticleCard.tsx:12–46  ·  view source on GitHub ↗
({ tabIndex, card, typeLabel }: Props)

Source from the content-addressed store, hash-verified

10}
11
12export const ArticleCard = ({ tabIndex, card, typeLabel }: Props) => {
13 return (
14 <li
15 tabIndex={tabIndex}
16 data-testid="article-card"
17 className="d-flex col-12 col-md-4 pr-0 pr-md-6 pr-lg-8"
18 >
19 <Link className="no-underline d-flex flex-column py-3 border-bottom" href={card.href}>
20 <h3 className="h4 color-fg-default mb-1">{card.title}</h3>
21 <div className="h6 text-uppercase" data-testid="article-card-type">
22 {typeLabel}
23 </div>
24 <p className="color-fg-muted my-3">{card.intro}</p>
25 {card.topics.length > 0 && (
26 <ul style={{ listStyleType: 'none' }}>
27 {card.topics.map((topic) => {
28 return (
29 <li className="d-inline-block" key={topic}>
30 <Label
31 data-testid="article-card-topic"
32 size="small"
33 variant="accent"
34 sx={{ mr: 1 }}
35 >
36 {topic}
37 </Label>
38 </li>
39 )
40 })}
41 </ul>
42 )}
43 </Link>
44 </li>
45 )
46}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected