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

@jotnar/m-card

v0.1.0

Published

A reusable Vue 3 card component with Tailwind CSS support

Readme

@jotnar/m-card

A versatile Vue 3 card component with Tailwind CSS 4 styling and Font Awesome support. Create customizable cards with images, avatars, icons, buttons, and flexible content layouts effortlessly!

📦 Installation

Install the package via npm:


npm  i  @jotnar/m-card@latest

Prerequisites: Ensure your project has Vue 3 (version 3.4.0 or higher), Tailwind CSS 4, and Font Awesome set up, as this component relies on Tailwind CSS classes for styling, Vue 3 for functionality, and Font Awesome for icons.

🧑‍💻 Usage

You can use the m-card component in your Vue 3 application either by registering it globally or locally in specific components.

🌐 Global Registration

Register the m-card component globally in your Vue app:

  1. Import the component in your main JavaScript file (e.g., main.js):
import { createApp } from 'vue'
import App from './App.vue'
import { MCard } from '@jotnar/m-card'

const app = createApp(App)
app.component('m-card', MCard)
app.mount('#app')
  1. Import the styles in your main JavaScript file (since the component includes styles in ):
import '@jotnar/m-card/style'
import 'tailwindcss'

Once these steps are complete, you can use the component anywhere in your app.

📦 Local Registration

Import and use the component in specific components:

<template>
  <m-card title="Welcome" description="This is a card!" primary-btn="Get Started" />
</template>

<script setup>
  import { MCard } from '@jotnar/m-card'
</script>

🎛️ Props

The m-card component offers a range of props to customize its appearance and behavior:

| Prop | Type | Default | Description | | ------------ | ------- | ------------------- | ---------------------------------------------------------------------------------- | | elevation | String | 'shadow' | Elevation style: shadow, shadow-md, shadow-lg, shadow-none. | | rounded | String | 'rounded-lg' | Rounding style: rounded, rounded-lg, rounded-xl, rounded-none. | | bordered | Boolean | false | Adds a border to the card. | | title | String | '' | The main title displayed in the card header. | | subtitle | String | '' | A smaller subtitle displayed below the title. | | description | String | '' | The main content text of the card. | | primaryBtn | String | '' | Label for the primary button (uses @jotnar/m-btn). | | secondaryBtn | String | '' | Label for the secondary button (uses @jotnar/m-btn, text variant). | | image | String | '' | URL for the card’s top image. | | avatar | String | '' | Name or URL for the avatar (uses @jotnar/m-avatar). | | icon | String | '' | Font Awesome icon class (e.g., fa-solid fa-star). | | imageSize | String | 'h-48' | Image height: h-32, h-48, h-64, h-auto. | | avatarImg | String | '' | URL for the avatar image (overrides avatar name). | | iconClass | String | 'card-icon-default' | CSS class for the icon (default: text-4xl p-2 text-primary-400). | | avatarColor | String | 'primary' | Avatar color: primary, secondary, tertiary, accent, info, success, warning, error. | | avatarStatus | String | 'online' | Avatar status: online, offline, away, busy, no disturb, null. |

🎉 Events

| Event | Description | | --------------- | --------------------------------------------- | | click:primary | Emitted when the primary button is clicked. | | click:secondary | Emitted when the secondary button is clicked. |

✨ Examples

<template>
  <div class="flex gap-4 flex-wrap">
    <!-- Basic Card -->
    <m-card
      title="Welcome"
      subtitle="Introduction"
      description="This is a basic card with buttons."
      primary-btn="Get Started"
      secondary-btn="Learn More"
      @click:primary="onPrimaryClick"
      @click:secondary="onSecondaryClick"
    />

    <!-- Card with Image -->
    <m-card
      title="Featured"
      image="https://example.com/image.jpg"
      image-size="h-32"
      description="A card with a top image."
      primary-btn="View Details"
    />

    <!-- Card with Avatar and Icon -->
    <m-card
      title="User Profile"
      avatar="John Doe"
      avatar-color="success"
      avatar-status="online"
      icon="fa-solid fa-user"
      description="A card with an avatar and icon."
    />

    <!-- Card with Slots -->
    <m-card elevation="shadow-lg" rounded="rounded-xl">
      <template #header>
        <h2 class="text-2xl font-bold">Custom Header</h2>
      </template>
      <template #body>
        <p>This is a custom body content.</p>
      </template>
      <template #footer>
        <button class="px-4 py-2 bg-blue-600 text-white rounded">Custom Action</button>
      </template>
    </m-card>
  </div>
</template>

<script setup>
  import { MCard } from '@jotnar/m-card'

  const onPrimaryClick = () => console.log('Primary button clicked')
  const onSecondaryClick = () => console.log('Secondary button clicked')
</script>

ℹ️ Notes

  • Custom Classes:
    If a custom class prop is provided (e.g., class="bg-blue-500 text-white"), it will override default styles, allowing full customization.
  • Icon Support:
    Icons require Font Awesome to be set up in your project. Use the format fa-solid fa-icon-name (e.g., fa-solid fa-star).
  • Accessibility:
    The card includes aria-label attributes for the container, avatar, icon, and buttons to ensure accessibility for screen readers. Buttons are keyboard-accessible.
  • Dependencies:
    The component uses @jotnar/m-avatar for avatars and @jotnar/m-btn for buttons. Ensure these are installed if using avatar, primaryBtn, or secondaryBtn props.
  • Styling:
    Styles are imported via @jotnar/m-card/style in the component’s , aligning with the library’s conventions.

🔨 Under Construction

The homepage for this project is currently under construction. In the meantime, you can find the source code and report issues on GitHub:

  • GitHub Repository
  • Report Issues

⚖️ License

MIT

👤 Author

Jotnar