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

@shashank_s/summary-card

v0.1.12

Published

SummaryCard React component (variant: basic) styled with shadcn/tailwind tokens.

Readme

SummaryCard (basic variant)

A small, theme-friendly Summary Card React component using shadcn/tailwind design tokens.

Install

npm install @shashank_s/summary-card
# or
yarn add @shashank_s/summary-card
# or
pnpm add @shashank_s/summary-card

Peer dependencies (expected in your app):

  • react (>=17)
  • react-dom (>=17)
  • tailwind + shadcn tokens (bg-card, border, text-foreground, text-muted-foreground, bg-muted, border-border)

Usage

import { SummaryCard } from '@shashank_s/summary-card'

export default function Example() {
  return (
    <SummaryCard
      variant="basic"
      title="MATI available"
      value="8,400 Tons"
      subtitle="5 Villages, 18 Clusters"
      enableSelection
      className="w-[240px]" // optional sizing override
    />
  )
}

Props

interface SummaryCardProps extends React.HTMLAttributes<HTMLDivElement> {
  title: string
  value: string | number
  subtitle?: string
  variant?: 'basic'
  enableSelection?: boolean // default: true
  onClick?: () => void
}
  • variant: currently only basic.
  • enableSelection: when true, clicking toggles a subtle selected state using shadcn tokens (bg-muted + border-border).

Styling

The component uses design tokens:

  • Base: bg-card border text-card-foreground
  • Selected: bg-muted border-border
  • Typography: text-sm font-medium, text-2xl font-bold, text-xs text-muted-foreground

You can pass additional classes via className (e.g., w-[240px], shadow-none, etc.).

Examples

Basic Usage

import { SummaryCard } from '@shashank_s/summary-card'

// Simple card with all props
<SummaryCard
  variant="basic"
  title="MATI available"
  value="8,400 Tons"
  subtitle="5 Villages, 18 Clusters"
/>

With Click Handler

// Card with click handler (selection still enabled)
<SummaryCard
  title="Users"
  value="1,234"
  subtitle="Active"
  onClick={() => console.log('Card clicked!')}
/>

// Card with click handler but no selection toggle
<SummaryCard
  title="KPI"
  value="98%"
  onClick={() => console.log('KPI clicked!')}
  enableSelection={false}
/>

Styling Examples

// Fixed width
<SummaryCard
  title="Revenue"
  value="$12,345"
  subtitle="This month"
  className="w-[240px]"
/>

// Custom styling
<SummaryCard
  title="Orders"
  value="456"
  subtitle="Pending"
  className="w-[300px] shadow-lg border-2"
/>

// No border
<SummaryCard
  title="Status"
  value="Online"
  className="border-0 shadow-none"
/>

Different Data Types

// String value
<SummaryCard
  title="Status"
  value="Active"
  subtitle="System running"
/>

// Number value
<SummaryCard
  title="Count"
  value={1234}
  subtitle="Total items"
/>

// No subtitle
<SummaryCard
  title="Temperature"
  value="72°F"
/>

Interactive Examples

import { useState } from 'react'

function Dashboard() {
  const [selectedCard, setSelectedCard] = useState<string | null>(null)

  return (
    <div className="grid grid-cols-3 gap-4">
      <SummaryCard
        title="Sales"
        value="$5,432"
        subtitle="This week"
        onClick={() => setSelectedCard('sales')}
        className={selectedCard === 'sales' ? 'ring-2 ring-blue-500' : ''}
      />
      
      <SummaryCard
        title="Orders"
        value="89"
        subtitle="Pending"
        onClick={() => setSelectedCard('orders')}
        className={selectedCard === 'orders' ? 'ring-2 ring-blue-500' : ''}
      />
      
      <SummaryCard
        title="Users"
        value="1,234"
        subtitle="Active"
        onClick={() => setSelectedCard('users')}
        className={selectedCard === 'users' ? 'ring-2 ring-blue-500' : ''}
      />
    </div>
  )
}

All Props Example

<SummaryCard
  // Required props
  title="Complete Example"
  value="100%"
  
  // Optional props
  subtitle="All systems operational"
  variant="basic"
  enableSelection={true}
  onClick={() => {
    console.log('Card clicked!')
    // Your custom logic here
  }}
  
  // Custom styling
  className="w-[280px] hover:shadow-xl transition-shadow"
  
  // Any other HTML div attributes
  id="summary-card-1"
  data-testid="summary-card"
  role="button"
  tabIndex={0}
  onKeyDown={(e) => {
    if (e.key === 'Enter' || e.key === ' ') {
      e.preventDefault()
      // Handle keyboard activation
    }
  }}
/>

Development

  • Build: npm run build
  • Types and ESM/CJS are emitted to dist/

Repository / Issues

  • Repository: https://github.com/shashank-samples/summary-card (placeholder)
  • Issues: https://github.com/shashank-samples/summary-card/issues

License

MIT