Skip to content

Components

Projex provides compound components for building project showcase pages. All components ship with zero styling - only semantic HTML with data attributes for CSS targeting.

Available Components

Preset Components

ComponentDescription
GitHubCardPre-built card for GitHub projects with stars, forks, language, and commits
NpmCardPre-built card for npm packages with downloads, version, and npm link
ShowcaseCardPre-built card for manual projects with live link and tech stack

Core Components

ComponentDescription
ProjectCardCard component for displaying individual project summaries
ProjectViewFull page view for detailed project information
ProjectGridContainer for grid layout of projects
ProjectListContainer for list layout of projects
FeaturedProjectFeatured project hero section

Design Principles

Compound Components

Components use the compound pattern for maximum flexibility. Consumers compose their own layout by combining subcomponents:

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

Data Attributes

Every rendered element includes a data-projex-* attribute for styling hooks:

css
[data-projex-card] {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
}

[data-projex-card-header] {
  display: flex;
  justify-content: space-between;
}

Conditional Rendering

Subcomponents return null when data is missing. No empty wrappers or placeholder text:

tsx
<ProjectCard.Tags project={project} /> {/* null if project.stack is empty */}
<ProjectCard.Stats project={project} /> {/* null if project.stats is null */}