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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@darksnow-ui/card

v1.0.0

Published

card component for DarkSnow UI

Readme

@darksnow-ui/card

A flexible card container component with header, content, and footer sections.

Installation

npm install @darksnow-ui/card
# or
yarn add @darksnow-ui/card
# or
pnpm add @darksnow-ui/card

Usage

import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@darksnow-ui/card"

export function Example() {
  return (
    <Card>
      <CardHeader>
        <CardTitle>Card Title</CardTitle>
        <CardDescription>Card description goes here</CardDescription>
      </CardHeader>
      <CardContent>
        <p>Card content. You can put any content here.</p>
      </CardContent>
      <CardFooter>
        <p className="text-sm text-theme-content-muted">Card footer</p>
      </CardFooter>
    </Card>
  )
}

Components

Card

The main container component.

| Prop | Type | Default | Description | |------|------|---------|-------------| | className | string | - | Additional CSS classes | | children | ReactNode | - | Card content |

CardHeader

Contains the card title and description.

| Prop | Type | Default | Description | |------|------|---------|-------------| | className | string | - | Additional CSS classes | | children | ReactNode | - | Header content |

CardTitle

The main title of the card.

| Prop | Type | Default | Description | |------|------|---------|-------------| | className | string | - | Additional CSS classes | | children | ReactNode | - | Title content |

CardDescription

Subtitle or description text.

| Prop | Type | Default | Description | |------|------|---------|-------------| | className | string | - | Additional CSS classes | | children | ReactNode | - | Description content |

CardContent

The main content area of the card.

| Prop | Type | Default | Description | |------|------|---------|-------------| | className | string | - | Additional CSS classes | | children | ReactNode | - | Content |

CardFooter

Footer section for actions or additional info.

| Prop | Type | Default | Description | |------|------|---------|-------------| | className | string | - | Additional CSS classes | | children | ReactNode | - | Footer content |

Examples

Basic Card

<Card className="w-full max-w-md">
  <CardHeader>
    <CardTitle>Notifications</CardTitle>
    <CardDescription>You have 3 unread messages.</CardDescription>
  </CardHeader>
  <CardContent>
    <p>Your content here.</p>
  </CardContent>
  <CardFooter>
    <p className="text-sm text-theme-content-muted">Last updated 2 hours ago</p>
  </CardFooter>
</Card>

Interactive Card with Actions

import { Button } from "@darksnow-ui/button"

<Card>
  <CardHeader>
    <CardTitle>Project Alpha</CardTitle>
    <CardDescription>Deploy your new project in one-click.</CardDescription>
  </CardHeader>
  <CardContent>
    <div className="grid gap-2">
      <div className="flex items-center justify-between text-sm">
        <span className="text-theme-content-muted">Progress</span>
        <span>72%</span>
      </div>
      <div className="w-full bg-theme-mark-light rounded-full h-2">
        <div
          className="bg-theme-accent h-2 rounded-full"
          style={{ width: "72%" }}
        ></div>
      </div>
    </div>
  </CardContent>
  <CardFooter className="flex justify-between">
    <Button variant="outline" size="sm">Cancel</Button>
    <Button size="sm">Deploy</Button>
  </CardFooter>
</Card>

Stats Card

<Card>
  <CardHeader>
    <CardTitle>Total Revenue</CardTitle>
    <CardDescription>Monthly revenue growth</CardDescription>
  </CardHeader>
  <CardContent>
    <div className="text-2xl font-bold">$45,231.89</div>
    <p className="text-xs text-theme-highlight mt-1">
      +20.1% from last month
    </p>
  </CardContent>
</Card>

Team Members Card

import { Badge } from "@darksnow-ui/badge"

<Card>
  <CardHeader>
    <CardTitle>Team Members</CardTitle>
  </CardHeader>
  <CardContent>
    <div className="space-y-4">
      <div className="flex items-center space-x-4">
        <div className="w-10 h-10 rounded-full bg-theme-accent flex items-center justify-center">
          JD
        </div>
        <div className="flex-1">
          <p className="text-sm font-medium">John Doe</p>
          <p className="text-xs text-theme-content-muted">[email protected]</p>
        </div>
        <Badge variant="outline">Admin</Badge>
      </div>
    </div>
  </CardContent>
  <CardFooter>
    <Button variant="outline" className="w-full">View all</Button>
  </CardFooter>
</Card>

Create/Empty State Card

<Card className="border-dashed">
  <CardContent className="flex flex-col items-center justify-center py-10">
    <svg
      className="h-10 w-10 text-theme-content-muted mb-4"
      fill="none"
      stroke="currentColor"
      viewBox="0 0 24 24"
    >
      <path
        strokeLinecap="round"
        strokeLinejoin="round"
        strokeWidth={2}
        d="M12 4v16m8-8H4"
      />
    </svg>
    <CardTitle className="mb-2">Create new project</CardTitle>
    <CardDescription className="text-center">
      Deploy your new project in one-click.
    </CardDescription>
    <Button className="mt-4">Create Project</Button>
  </CardContent>
</Card>

Hover Effects

<Card className="hover:shadow-lg transition-shadow cursor-pointer">
  <CardHeader>
    <CardTitle>Clickable Card</CardTitle>
    <CardDescription>This card has hover effects</CardDescription>
  </CardHeader>
  <CardContent>
    <p>Hover over me to see the shadow effect.</p>
  </CardContent>
</Card>

Grid Layout

<div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
  <Card>
    <CardHeader>
      <CardTitle>Card 1</CardTitle>
    </CardHeader>
    <CardContent>Content 1</CardContent>
  </Card>
  
  <Card>
    <CardHeader>
      <CardTitle>Card 2</CardTitle>
    </CardHeader>
    <CardContent>Content 2</CardContent>
  </Card>
  
  <Card>
    <CardHeader>
      <CardTitle>Card 3</CardTitle>
    </CardHeader>
    <CardContent>Content 3</CardContent>
  </Card>
</div>

Styling

The card components use these CSS classes:

  • Card: rounded-xl border border-theme-mark-light bg-theme-surface text-theme-content shadow-theme-md
  • CardHeader: flex flex-col space-y-1.5 p-6
  • CardTitle: font-semibold leading-none tracking-tight
  • CardDescription: text-sm text-theme-content-muted
  • CardContent: p-6 pt-0
  • CardFooter: flex items-center p-6 pt-0

Accessibility

  • Semantic HTML structure with proper heading hierarchy
  • Supports keyboard navigation when interactive
  • Color contrast meets WCAG guidelines
  • Screen reader friendly content structure

Theming

The card uses CSS custom properties for theming:

  • --theme-surface - Card background
  • --theme-mark-light - Border color
  • --theme-content - Text color
  • --theme-content-muted - Muted text color

License

MIT © DarkSnow UI