Socket
Socket
Sign inDemoInstall

@paprika/card

Package Overview
Dependencies
96
Maintainers
3
Versions
69
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @paprika/card

The Card component is a customizable content container.


Version published
Weekly downloads
412
decreased by-13.63%
Maintainers
3
Install size
2.98 MB
Created
Weekly downloads
 

Readme

Source

@paprika/card

Description

The Card component is a customizable content container.

Installation

yarn add @paprika/card

or with npm:

npm install @paprika/card

Props

Card

PropTyperequireddefaultDescription
childrennodefalsenullBody content of the card.
isFullWidthboolfalsefalseIf the width of the card should span it's parent container (100%).
isActiveboolfalsefalseIf the card is in an "active" or "selected" state.
size[ Card.types.size.AUTO, Card.types.size.SMALL, Card.types.size.MEDIUM, Card.types.size.LARGE]falseCard.types.size.AUTOSize of the card (font size, min-height, padding, etc).

Card.Content

PropTyperequireddefaultDescription
childrennodefalsenullPrimary content.

Card.Footer

PropTyperequireddefaultDescription
childrennodefalsenullBody content of the footer

Card.Header

PropTyperequireddefaultDescription
childrennodefalsenullPrimary content.

Card.Metadata

PropTyperequireddefaultDescription
childrennodefalsenullPrimary content.

Card.Text

PropTyperequireddefaultDescription
childrennodefalsenullBody content of the Text.
maxTextLengthnumberfalse95Sets the maximum text length visible on the card

Card.Title

PropTyperequireddefaultDescription
childrennodefalsenullBody content of the Title.

Card

The <Card> component is a customizable content container. It comes with subcomponents that allow for quick and easy creation of various card types for different use cases. Additionally any other child elements can be passed into the Card.

Usage

To create a card simply add the <Card></Card> element. You can set the card to one the of three preset sizes (small, medium, and large) or alternatively you can add a isFullWidth or isAutoHeight property to the card. You can then add several children elements of your choice or use one of the many subcomponents to create your card.

Note: When using the size property the width and height are fixed therefore consideration will have to be given to size of content passed into the Card.

<Card size="medium">
  <Card.Header>
    <Avatar>E</Avatar>
  </Card.Header>
  <Card.Content>
    <Card.Title>Example</Card.Title>
    <Card.Metadata>metadata</Card.Metadata>
    <div style={{ width: "100%", height: "24px" }} />
    <Card.Text>This is an example of a medium sized Card</Card.Text>
    <div style={{ width: "100%", height: "24px" }} />
    <Card.Metadata>Created by Kaan</Card.Metadata>
    <Card.Metadata>Last updated by Karen</Card.Metadata>
  </Card.Content>
  <Card.Footer>
    <div
      style={{
        display: "flex",
        flexDirection: "row",
        justifyContent: "space-between",
        alignItems: "center",
      }}
    >
      <span>150 attributes</span>
      <span>10 questions</span>
    </div>
  </Card.Footer>
</Card>
  • Storybook Showcase
  • GitHub source code
  • Create GitHub issue
  • CHANGELOG

FAQs

Last updated on 22 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc