Skip to content

ProjectCard

Card component for displaying individual project summaries. Uses compound component pattern for flexible composition.

Import

tsx
import { ProjectCard } from '@manningworks/projex'

Usage

tsx
<ProjectCard>
  <ProjectCard.Header project={project} />
  <ProjectCard.Description project={project} />
  <ProjectCard.Tags project={project} />
  <ProjectCard.Stats project={project} />
  <ProjectCard.Status project={project} />
  <ProjectCard.Links project={project} />
</ProjectCard>

Props

ProjectCard (Root)

PropTypeRequiredDescription
childrenReact.ReactNodeYesChild components to render inside the card

ProjectCard.Header

PropTypeRequiredDescription
projectProjexProjectYesProject data to display

ProjectCard.Description

PropTypeRequiredDescription
projectProjexProjectYesProject data to display

Returns null if project.description is empty.

ProjectCard.Tags

PropTypeRequiredDescription
projectProjexProjectYesProject data to display

Returns null if project.stack is empty.

ProjectCard.Stats

PropTypeRequiredDescription
projectProjexProjectYesProject data to display

Returns null if project.stats is empty or contains no values.

ProjectCard.Status

PropTypeRequiredDescription
projectProjexProjectYesProject data to display
PropTypeRequiredDescription
projectProjexProjectYesProject data to display

Returns null if no links are available.

Data Attributes

AttributeValueDescription
data-projex-card-Root card container
data-projex-card-header-Header section
data-projex-card-description-Description section
data-projex-card-tags-Tags container
data-projex-card-stats-Stats container
data-projex-card-links-Links container
data-projex-status-Status badge
data-projex-status-valueactive | shipped | ...Current status
data-projex-type-Type badge
data-projex-type-valuegithub | npm | ...Project type
data-projex-tag-Individual tag
data-projex-link-Link element
data-projex-link-typegithub | live | docs | demo | npm | product-hunt | customLink type
data-projex-link-labelstringCustom link label
data-projex-statstars | forks | downloads | version | upvotes | commentsStat type
data-projex-github-card-Present when project type is 'github'
data-projex-og-imagestringOpenGraph image URL (if project has image)
data-projex-og-titlestringOpenGraph title (project name)
data-projex-og-descriptionstringOpenGraph description (if project has description)

Example

tsx
import { ProjectCard } from '@manningworks/projex'

function ProjectShowcase({ projects }) {
  return (
    <div className="grid grid-cols-3 gap-4">
      {projects.map((project) => (
        <ProjectCard key={project.id}>
          <ProjectCard.Header project={project} />
          <ProjectCard.Description project={project} />
          <ProjectCard.Tags project={project} />
          <ProjectCard.Stats project={project} />
          <ProjectCard.Status project={project} />
          <ProjectCard.Links project={project} />
        </ProjectCard>
      ))}
    </div>
  )
}