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 🙏

© 2024 – Pkg Stats / Ryan Hefner

annween_simplecards

v0.1.5

Published

SimpleCards is a versatile React component library that empowers you to effortlessly create visually appealing cards with flexible image positions. Whether you want your images on the left, right, or any other position, SimpleCards has got you covered. Th

Downloads

1

Readme

SimpleCards - React Component Library

SimpleCards is a versatile React component library that empowers you to effortlessly create visually appealing cards with flexible image positions. Whether you want your images on the left, right, or any other position, SimpleCards has got you covered. This library streamlines the process of designing and laying out cards, making it a perfect choice for developers looking to enhance user interfaces with stunning card-based content.

Features

  • Create cards with images positioned on the left, right, or anywhere in between.
  • Highly customizable content, including titles and descriptions.
  • Easy-to-use integration into your React applications.
  • Perfect for showcasing content in a visually engaging way.

Installation

Install SimpleCards into your project using npm:

npm install simple-cards

Usage

Import SimpleCards into your React project:

import { Cards } from 'simple-cards';

const App = () => {
  // Your data
  return (
    <Cards
      amount={integer}
      images={array}
      content={array}
      position={array}
    />
  );
};

export default App;

Props

| Prop | Type | Description | |------------|-----------|-----------------------------------------------------------------------------| | amount | number | The number of cards to be rendered. | | images | array | Optional : An array of image objects (See structure below). | | content | array | An array of content objects (See structure below). | | position | array | Optional : The position of the image in the card. | | style | string | The style of the card background. Choose from 'dark', 'luminous', 'default'. | | rounded | boolean | Whether to add rounded corners to the cards. |

Structure of content prop

The content array should contain objects representing the content that you want to display within the cards. Each object should have the following properties:

title (string): The title of the card content.
description (string): The description or text content of the card.

Here's an example of how the content array could be structured:

[
  {
    title: 'Title 1',
    description: 'Description 1',
  },
  {
    title: 'Title 2',
    description: 'Description 2',
  },
	// Add more content objects as needed
]

Structure of images prop

The images array should contain objects representing the images that you want to display within the cards. Each object should have the following properties:

src (string): The URL or local path of the image.
alt (string): The alt text of the image.
size (string): The size of the image. Can be any valid CSS value.

Here's an example of how the images array could be structured:

```jsx
[
{
    src: 'image-url-1',
    alt: 'Image 1',
    size: '50%', // Optional
},
{
    src: 'image-url-2',
    alt: 'Image 2',
    size: '150px', // Optional
},
    // Add more image objects as needed
]
```

Size is optional. If you don't specify a size, the image will be rendered at its original size.

Note: If you choose to add images in your cards the number of image objects in the array should match the number of cards you want to render.

Examples

Basic Usage

<Cards
	amount={2}
	images={[
		{
			src: 'image-url-1',
			alt: 'Image 1',
			size: '50%', // can be any valid CSS value
		},
		{
			src: 'image-url-2',
			alt: 'Image 2',
			size: '150px', // can be any valid CSS value
		},
	]}
	content={[
		{
			title: 'Title 1',
			description: 'Description 1',
		},
		{
			title: 'Title 2',
			description: 'Description 2',
		}
		// ...
	]}
	position={['left', 'right']}
	style="dark"   // Choose from 'dark', 'luminous', 'default'
	rounded={true} // true for rounded corners, false for square
/>