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

@marketplaces.inc-ui/mpc-card

v0.0.6

Published

### class: `Card`, `mpc-card`

Downloads

3

Readme

src/Card.js:

class: Card, mpc-card

Superclass

| Name | Module | Package | | ------------ | ------ | ------- | | LitElement | | lit |

Fields

| Name | Privacy | Type | Default | Description | Inherited From | | ----------------- | ------- | --------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | | title | public | string | '' | Title of the card | | | subtitle | public | string | '' | Subtitle of the card, shown above the title if present | | | href | public | string | '' | When present, clicking the card will route to this string | | | images | public | array | [] | Array of image urls, only the first image will be shown | | | loading | public | boolean | false | Show the loading state | | | buttonText | public | string | '' | When present, a button is shown at the buttom of the card | | | currency | public | string | '' | When present, a currency is shown next to the price | | | currencySymbol | public | string | '$' | The symbol to show before price string. Only used when price is set. | | | currencyFormat | public | string | '0,0[.]00' | The format string to display the price in, see <a href="http://numeraljs.com" target="_blank">numeraljs.com</a> for a full list of options | | | darkMode | public | string | 'disabled' | The theme of the card, valid options are `disabled`, `auto` & `active`. The auto strategy uses the `prefers-color-scheme` media feature under the hood, it will not listen for color changes when set to auto | | | autoFetch | public | boolean | false | When true, autofetch data from the MPC API and apply it. See `autoFetchConfig` for more info. | | | autoFetchConfig | public | object | {} | Auto fetch data for the card when required params are supplied<br/> `{`<br/> &nbsp;`entityId,`<br/> &nbsp;`entityType,`<br/> &nbsp;`marketplaceId,`<br/> &nbsp;`marketplaceBaseUrl,`<br/> &nbsp;`apiKey,`<br/> &nbsp;`apiBaseUrl,`<br/> `}` <br/><br/> `entityType` options are `listing` | | | target | public | | | Tells the browser where to open the link. Only used when href is set. | | | price | public | | | When present, a price is shown. Formatted by numeral.js | |

Methods

| Name | Privacy | Description | Parameters | Return | Inherited From | | -------------------------------- | ------- | ----------- | ------------------ | ------ | -------------- | | _handleAutoFetch | | | autoFetch | | | | _handleAutoFetchResponse | | | data, entityType | | | | _handleSetPropertiesForListing | | | data | | | | mediaTemplate | | | | | | | loadingTemplate | | | | | | | contentTemplate | | | | | |

Attributes

| Name | Field | Inherited From | | ----------------- | --------------- | -------------- | | title | title | | | subtitle | subtitle | | | images | images | | | loading | loading | | | href | href | | | target | target | | | buttonText | buttonText | | | price | price | | | currency | currency | | | currencySymbol | currencySymbol | | | currencyFormat | currencyFormat | | | darkMode | darkMode | | | autoFetch | autoFetch | | | autoFetchConfig | autoFetchConfig | |

Exports

| Kind | Name | Declaration | Module | Package | | ---- | ------ | ----------- | ----------- | ------- | | js | Card | Card | src/Card.js | |

mpc-card.js:

Exports

| Kind | Name | Declaration | Module | Package | | --------------------------- | ---------- | ----------- | ------------ | ------- | | custom-element-definition | mpc-card | Card | /src/Card.js | |