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

@ant-design/x-card

v2.5.0

Published

React card loader for dynamic content loading and management

Readme

@ant-design/x-card

React card loader for dynamic content loading and management.

Features

  • 🚀 Dynamic Loading: Load cards asynchronously with configurable concurrency
  • 🔄 Retry Mechanism: Automatic retry with exponential backoff
  • Performance: Optimized for large datasets with virtual scrolling support
  • 🎨 Customizable: Fully customizable card rendering and loading states
  • 📱 Responsive: Mobile-friendly responsive design
  • 🔧 TypeScript: Full TypeScript support

Installation

npm install @ant-design/x-card
# or
yarn add @ant-design/x-card
# or
pnpm add @ant-design/x-card

Usage

Basic Usage

import React from 'react';
import { CardLoader } from '@ant-design/x-card';

const App = () => {
  const cards = [
    {
      id: '1',
      title: 'Card 1',
      content: 'This is card content',
    },
    {
      id: '2',
      title: 'Card 2',
      content: 'Another card content',
    },
  ];

  return <CardLoader cards={cards} />;
};

Advanced Usage

import React from 'react';
import { CardLoader, useCardLoader } from '@ant-design/x-card';

const App = () => {
  const { state, actions } = useCardLoader({
    config: {
      maxConcurrent: 5,
      retryCount: 3,
      timeout: 10000,
    },
    customLoader: async (card) => {
      // Custom loading logic
      const response = await fetch(`/api/cards/${card.id}`);
      const data = await response.json();
      return data.content;
    },
  });

  React.useEffect(() => {
    actions.loadCards([
      { id: '1', title: 'Dynamic Card 1' },
      { id: '2', title: 'Dynamic Card 2' },
    ]);
  }, []);

  return (
    <CardLoader
      cards={state.cards}
      renderLoading={(card) => <div>Loading {card.title}...</div>}
      renderError={(error, card) => <div>Error: {error.message}</div>}
    />
  );
};

Using Hooks

import React from 'react';
import { useCardLoader } from '@ant-design/x-card';

const App = () => {
  const { state, actions } = useCardLoader();

  const addNewCard = () => {
    actions.addCard({
      id: Date.now().toString(),
      title: 'New Card',
      content: 'Dynamic content',
    });
  };

  return (
    <div>
      <button onClick={addNewCard}>Add Card</button>
      {state.cards.map((card) => (
        <div key={card.id}>
          <h3>{card.title}</h3>
          <p>{card.content}</p>
        </div>
      ))}
    </div>
  );
};

API

CardLoader Props

| Property | Type | Default | Description | | ---------------- | ------------------ | ------- | ----------------------------- | | cards | CardLoaderConfig[] | [] | Array of card configurations | | config | CardLoaderConfig | - | Loader configuration | | customLoader | function | - | Custom card loading function | | renderEmpty | function | - | Custom empty state renderer | | renderLoading | function | - | Custom loading state renderer | | renderError | function | - | Custom error state renderer | | onLoadingChange | function | - | Loading state change callback | | onCardLoad | function | - | Card load success callback | | onCardError | function | - | Card load error callback | | onAllCardsLoaded | function | - | All cards loaded callback |

CardLoaderConfig

| Property | Type | Default | Description | | --- | --- | --- | --- | | id | string | - | Unique card identifier | | title | string | - | Card title | | content | ReactNode | - | Card content | | type | 'default' | 'info' | 'success' | 'warning' | 'error' | 'default' | Card type | | loading | boolean | false | Loading state | | closable | boolean | false | Whether card can be closed | | size | 'small' | 'middle' | 'large' | 'middle' | Card size | | disabled | boolean | false | Whether card is disabled | | className | string | - | Custom CSS class | | style | CSSProperties | - | Custom inline style | | extra | ReactNode | - | Extra content in card header |

useCardLoader Hook

Returns an object with:

  • state: Current loader state
  • actions: Available actions
    • addCard(card): Add a new card
    • removeCard(id): Remove a card
    • updateCard(id, updates): Update a card
    • reloadCard(id): Reload a card
    • clearCards(): Clear all cards
    • getCardState(id): Get card state
    • loadCards(cards): Load multiple cards

Development

# Install dependencies
npm install

# Start development
npm run start

# Run tests
npm test

# Build
npm run compile

License

MIT