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

Function ComponentCard

packages/dev/s2-docs/src/ComponentCard.tsx:592–635  ·  view source on GitHub ↗
({
  id,
  name,
  href,
  description,
  size,
  ...otherProps
}: ComponentCardProps)

Source from the content-addressed store, hash-verified

590}
591
592export function ComponentCard({
593 id,
594 name,
595 href,
596 description,
597 size,
598 ...otherProps
599}: ComponentCardProps) {
600 let preview;
601 let releaseVersion = getReleaseVersionLabel(href);
602
603 if (releaseVersion) {
604 preview = (
605 <div className={illustrationContainer}>
606 {/* Background gradient */}
607 <Image
608 alt=""
609 styles={backgroundStyles}
610 src={[
611 {srcSet: BackgroundLight, colorScheme: 'light'},
612 {srcSet: BackgroundDark, colorScheme: 'dark'}
613 ]}
614 />
615 <span className={releaseText}>{releaseVersion}</span>
616 </div>
617 );
618 } else if (href.includes('examples/') && !href.endsWith('/')) {
619 preview = <ExampleImage name={href} />;
620 } else {
621 preview = <ComponentIllustration name={name} href={href} />;
622 }
623
624 return (
625 <ComponentCardClient
626 {...otherProps}
627 id={id}
628 href={href}
629 size={size}
630 name={name}
631 description={description}
632 preview={preview}
633 />
634 );
635}
636
637interface ComponentListProps {
638 pages: Page[];

Callers

nothing calls this directly

Calls 1

getReleaseVersionLabelFunction · 0.85

Tested by

no test coverage detected