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

@sio-group/ui-card

v0.3.5

Published

[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC) ![npm](https://img.shields.io/npm/v/@sio-group/ui-card) ![TypeScript](https://img.shields.io/badge/types-Yes-brightgreen)

Readme

@sio-group/ui-card

License: ISC npm TypeScript

A flexible and accessible card component for React applications. The card supports both simple configuration through props and full layout control through composable subcomponents.


Features

  • 🎨 Flexible composition – Use Card.Header, Card.Body, and Card.Footer
  • 🧩 Two APIs – Simple props-based usage or full composition control
  • 🔧 Configuration via props – Or let the modal generate fallback components automatically
  • 🎨 Custom styling – Supports custom classes and inline styles
  • 📦 Lightweight – Minimal dependencies

Installation

npm install @sio-group/ui-card

Peer dependencies

This package requires:

  • react ^19.0.0
  • react-dom ^19.0.0

Quick Example

import { Card } from "@sio-group/ui-card";

function Example() {
    return (
        <Card title="Example">
          Hello world
        </Card>
    );
}

Styling

Import the base modal styles:

import "@sio-group/ui-card/sio-card-style.css";

Basic Usage (Props)

The simplest way to use the card is by configuring it via props.

import { Card } from "@sio-group/ui-card";

function App() {
  return (
    <>
      <Card
        title="My Card"
        subtitle="A subtitle for extra context"
      >
        <p>This is the card content.</p>
        <p>You can place any React component here.</p>
      </Card>
    </>
  );
}

Simple card

Example modal using fallback components


When to use Props vs Composition

The card can be used in two ways depending on the level of control you need.

Props-based usage (recommended for most cases)

Use props when you only need a simple card with a title and content. This approach is quick to implement and keeps your code concise.

<Card
  title="Some title"
>
  This is awesome content
</Card>

Composition API (for advanced layouts)

Use the composition API when you need full control over the card structure or custom layouts.

<Card>
  <Card.Header>
    <h2>Custom Header</h2>
  </Card.Header>

  <Card.Body>
    Complex custom content
  </Card.Body>

  <Card.Footer>
    Custom footer
  </Card.Footer>
</Card>

In this mode you control the complete layout and behavior of each section.


Composition API

The card can be composed using the following structure:

Card
 ├─ Card.Header
 ├─ Card.Body
 └─ Card.Footer

These components give you full control over the card layout. If one of these components is omitted, the modal may generate a fallback automatically.

import { Card } from "@sio-group/ui-card";

function App() {
  return (
    <>
      <Card addShadow>

        <Card.Header>
          <h2>Custom Header</h2>
          <p>Additional information</p>
        </Card.Header>

        <Card.Body>
          <div className="custom-content">
            <p>Full control over the body content</p>

            <form>
              <input type="text" placeholder="Name" />
              <input type="email" placeholder="Email" />
            </form>
          </div>
        </Card.Body>

        <Card.Footer>
          <button className="btn-primary">Submit</button>
        </Card.Footer>

      </Card>
    </>
  );
}

Custom card

card modal using composition


API Reference

Modal Props

| Prop | Type | Default | Description | |-------------------|--------------------------------|---------|---------------------------------------------| | addShadow | boolean | false | Controls whether the card has a shadow | | children | ReactNode | — | Modal content | | className | string | — | Additional CSS classes for the modal dialog | | style | CSSProperties | — | Inline styles for the modal dialog | | title | string | — | Title used by the fallback header | | subtitle | string | — | Subtitle used by the fallback header | | actions | (ButtonProps \| LinkProps)[] | — | Action buttons (from @sio-group/ui-core) |


Subcomponents

Card.Header

| Prop | Type | Default | Description | |-------------|--------------|---------|-------------------------| | children | ReactNode | — | Header content |


Card.Body

| Prop | Type | Description | |------------|-------------|-------------------| | children | ReactNode | Card body content |


Card.Footer

| Prop | Type | Description | |------------|-------------|----------------| | children | ReactNode | Footer content |

@SiO-group/form-react integration

When using @sio-group/form-react inside a Card, the form is rendered as part of the card content.

By default the entire form (fields and buttons) is rendered inside the card body.

To integrate the form with the card layout, you can map the form containers to the card subcomponents:

<Card>
  <Form
  ...
  container={Card.Body}
  buttonContainer={Card.Footer}
  />
</Card>

In this case:

  • the form fields are rendered inside Card.Body
  • the form buttons are rendered inside Card.Footer

Automatic Fallback Components

If you do not provide subcomponents, the card will generate them automatically.

  • Header Generated when title or subtitle is present.

  • Body Generated from all children that are not Card.Header or Card.Footer.

  • Footer Generated when the actions prop is provided (and not empty).


TypeScript

This package includes full TypeScript definitions.

import { Card, CardProps } from "@sio-group/ui-card";

Browser Support

The modal supports all modern browsers that support:

  • ES6 modules
  • React portals

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the ISC License - see the LICENSE file for details.