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

Function ComponentList

packages/dev/s2-docs/src/ComponentCard.tsx:593–635  ·  view source on GitHub ↗
(props: ComponentListProps)

Source from the content-addressed store, hash-verified

591}
592
593export function ComponentList(props: ComponentListProps) {
594 let pages = props.pages.filter(page => props.components.includes(page.name));
595 return (
596 <ul
597 className={style({
598 display: 'flex',
599 gap: 24,
600 listStyleType: 'none',
601 overflow: 'auto',
602 '--paddingX': {
603 type: 'paddingStart',
604 value: {
605 default: 12,
606 lg: 40
607 }
608 },
609 paddingX: '--paddingX',
610 marginX: {
611 default: -12,
612 lg: -40
613 },
614 paddingY: 20,
615 marginY: -20,
616 scrollSnapType: 'x',
617 scrollPaddingX: '--paddingX'
618 })}
619 style={{
620 maskImage:
621 'linear-gradient(to right, transparent, white var(--paddingX) calc(100% - var(--paddingX)), transparent)'
622 }}>
623 {pages.map(page => (
624 <li key={page.url}>
625 <ComponentCard
626 name={getTitle(page)}
627 href={page.url}
628 size="S"
629 UNSAFE_style={{scrollSnapAlign: 'start'}}
630 />
631 </li>
632 ))}
633 </ul>
634 );
635}
636
637const getTitle = (page: Page) => page.tableOfContents?.[0]?.title ?? '';

Callers

nothing calls this directly

Calls 2

getTitleFunction · 0.70
filterMethod · 0.65

Tested by

no test coverage detected