npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@phila/phila-ui-cards

v0.1.0

Published

Card components for page content

Readme

@phila/phila-ui-cards

Card components for displaying content in various layouts. Includes pre-built card variants and a grid layout system.

Installation

npm install @phila/phila-ui-cards
# or
yarn add @phila/phila-ui-cards
# or
pnpm add @phila/phila-ui-cards

Quick Start

<script setup lang="ts">
import { ResourceCard, CardGrid } from "@phila/phila-ui-cards";
import { faMemo } from "@fortawesome/pro-solid-svg-icons";
</script>

<template>
  <CardGrid mode="grid" minCardWidth="343px">
    <ResourceCard
      heading="Citizens Planning Institute"
      :iconProps="{ iconDefinition: faMemo }"
      href="https://www.phila.gov"
    >
      <p>Card content goes here.</p>
    </ResourceCard>
  </CardGrid>
</template>

Components

Card Variants

Pre-styled card components for common use cases.

| Component | Description | | ------------------ | -------------------------------------------------------------------------------------- | | ResourceCard | Centered content with circular icon, primary heading color, and orange icon background | | PressReleaseCard | Left-aligned content with icon for press releases and news | | MediaCard | Vertical layout with image on top, content below | | FlagCard | Horizontal/responsive layout with image, content, and call-to-action button |

Base Components

Lower-level components for building custom card layouts.

| Component | Description | | ------------- | -------------------------------------------------------------- | | BaseCard | Base card wrapper with layout system and optional link support | | CardContent | Content area with icon, heading, text, and optional button | | CardImage | Image component for cards |

Layout

| Component | Description | | ---------- | ------------------------------------------------- | | CardGrid | Grid/flexbox layout for organizing multiple cards |

Imports

Components

import {
  // Card Variants
  ResourceCard,
  PressReleaseCard,
  MediaCard,
  FlagCard,
  // Base Components
  BaseCard,
  CardContent,
  CardImage,
  // Layout
  CardGrid,
} from "@phila/phila-ui-cards";

Types

import type {
  // Base Component Types
  BaseCardProps,
  CardContentProps,
  CardImageProps,
  CardLayout,
  HeadingColor,
  // Layout Types
  CardGridProps,
  CardGridMode,
  CardGridAlign,
  // Variant Types
  ResourceCardProps,
  PressReleaseCardProps,
  MediaCardProps,
  FlagCardProps,
} from "@phila/phila-ui-cards";

Card Variant Props

ResourceCard

Centered card with circular icon background. The entire card can be a clickable link.

| Prop | Type | Default | Description | | ----------- | --------------- | ------- | ------------------------------------------------------------------ | | heading | string | - | Card title | | iconProps | BaseIconProps | - | Icon configuration (from @phila/phila-ui-core) | | href | string | - | Link destination. When provided, the entire card becomes clickable | | className | string | - | Additional CSS classes |

<ResourceCard
  heading="Citizens Planning Institute"
  :iconProps="{ iconDefinition: faMemo }"
  href="https://www.phila.gov"
>
  <p>Our newsletter keeps you up-to-date on permits, licenses, and more.</p>
</ResourceCard>

PressReleaseCard

Left-aligned card for press releases and news items.

| Prop | Type | Default | Description | | ----------- | --------------- | ------- | ---------------------- | | heading | string | - | Card title | | iconProps | BaseIconProps | - | Icon configuration | | className | string | - | Additional CSS classes |

<PressReleaseCard heading="Philadelphia Announces New Initiative" :iconProps="{ iconDefinition: faMemo }">
  <p>June 10, 2025</p>
</PressReleaseCard>

MediaCard

Vertical card with image on top.

| Prop | Type | Default | Description | | ----------- | --------------- | ------- | ---------------------- | | heading | string | - | Card title | | iconProps | BaseIconProps | - | Icon configuration | | source | string | - | Image URL | | alt | string | - | Image alt text | | className | string | - | Additional CSS classes |

<MediaCard heading="City Hall Event" source="https://example.com/image.jpg" alt="City Hall">
  <p>Event description goes here.</p>
</MediaCard>

FlagCard

Horizontal/responsive card with image, content, and button.

| Prop | Type | Default | Description | | ------------ | -------------------------------------------- | -------------- | ---------------------------------- | | heading | string | - | Card title | | iconProps | BaseIconProps | - | Icon configuration | | source | string | - | Image URL | | alt | string | - | Image alt text | | buttonText | string | - | Button label | | buttonHref | string | - | Button link destination | | layout | "horizontal" \| "vertical" \| "responsive" | "responsive" | Layout mode | | reverse | boolean | false | Reverse order of image and content | | className | string | - | Additional CSS classes |

<FlagCard
  heading="Featured Article"
  source="https://example.com/image.jpg"
  alt="Article image"
  buttonText="Read More"
  buttonHref="/article"
  layout="responsive"
>
  <p>Article summary goes here.</p>
</FlagCard>

CardGrid Props

Layout component for organizing multiple cards.

| Prop | Type | Default | Description | | -------------- | ---------------------------------- | ----------- | ----------------------------------------------------------------------------------------------- | | mode | "grid" \| "flex" | "grid" | Layout mode. grid uses CSS Grid auto-fit. flex uses flexbox where cards expand to fill rows | | minCardWidth | string | "280px" | Minimum card width before wrapping | | align | "start" \| "center" \| "stretch" | "stretch" | Vertical alignment of cards | | className | string | - | Additional CSS classes |

<!-- Grid mode: cards maintain consistent widths -->
<CardGrid mode="grid" minCardWidth="343px">
  <ResourceCard ... />
  <ResourceCard ... />
  <ResourceCard ... />
</CardGrid>

<!-- Flex mode: cards on each row expand to fill available space -->
<CardGrid mode="flex" minCardWidth="343px">
  <ResourceCard ... />
  <ResourceCard ... />
  <ResourceCard ... />
</CardGrid>

Base Component Props

BaseCard

Base wrapper component used by all card variants.

| Prop | Type | Default | Description | | ----------- | -------------------------------------------- | -------------- | ------------------------------------------------------------------------------------ | | variant | "primary" \| "secondary" | "primary" | Visual variant | | layout | "horizontal" \| "vertical" \| "responsive" | "responsive" | Layout mode for image/content arrangement | | reverse | boolean | false | Reverse order of image and content | | href | string | - | Link destination. When provided, the entire card becomes clickable with hover effect | | className | string | - | Additional CSS classes |

CardContent

Content area component with heading, icon, and optional button.

| Prop | Type | Default | Description | | -------------- | -------------------------- | ----------- | ----------------------- | | heading | string | - | Content heading | | iconProps | BaseIconProps | - | Icon configuration | | variant | "primary" \| "secondary" | "primary" | Visual variant | | centered | boolean | false | Center-align content | | headingColor | "default" \| "primary" | "default" | Heading color variant | | buttonText | string | - | Button label | | buttonHref | string | - | Button link destination | | className | string | - | Additional CSS classes |

CardImage

Image component for cards.

| Prop | Type | Default | Description | | ----------- | -------- | ------- | ---------------------- | | source | string | - | Image URL | | alt | string | - | Image alt text | | className | string | - | Additional CSS classes |

Building Custom Cards

Use the base components to create custom card layouts:

<script setup lang="ts">
import { BaseCard, CardContent, CardImage } from "@phila/phila-ui-cards";
</script>

<template>
  <BaseCard layout="horizontal" href="/my-link">
    <CardImage source="https://example.com/image.jpg" alt="Description" />
    <CardContent heading="Custom Card" headingColor="primary" centered>
      <p>Custom card content.</p>
    </CardContent>
  </BaseCard>
</template>

License

MIT