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

@kong-ui-public/metric-cards

v0.9.54

Published

A Kong UI component for display Traffic, Error Rate, and P99 Latency insights in a card-like format

Downloads

2,448

Readme

@kong-ui-public/metric-cards

A Kong UI component for display Traffic, Error Rate, and P99 Latency insights in a card-like format

Features

  • Displays a summary panel containing various metrics
  • Supports custom color themes via CSS variables

Requirements

  • vue must be initialized in the host application
  • @kong/kongponents must be available as a dependency in the host application, along with the package's style imports. See here for instructions on installing Kongponents. Specifically, the following Kongponents must be available:
    • KIcon
    • KSkeletonBox
    • KTooltip

CSS Variables

Variable | Description | Default ---------|----------|--------- --kong-ui-metric-card-background | The background of the .kong-ui-public-metric-card-container main container | transparent --kong-ui-metric-card-title | Metric card title font color | # --kong-ui-metric-card-value | Metric value and description font color | # --kong-ui-metric-card-trend-negative | Negative trend font color | #AD000E --kong-ui-metric-card-trend-positive | Positive trend font color | #07a88d --kong-ui-metric-card-trend-neutral | Neutral trend font color | #52596E --kong-ui-metric-card-trend-bg-negative | Negative trend background color | #FFE5E5 --kong-ui-metric-card-trend-bg-positive | Positive trend background color | #ECFFFB --kong-ui-metric-card-trend-bg-neutral | Neutral trend background color | #E0E4EA

Install

yarn add @kong-ui-public/metric-cards

Props

cardType

One of the three golden signals (Traffic, Error Rate, Latency) or a Generic count

  • type: MetricCardType
  • required: false

title

Title to be displayed in the metric card header

  • type: String
  • required: false

titleTag

HTML element you want title to be rendered as.

  • type: String
  • required: false
  • default: h2

tooltip

Deprecated

  • type: String
  • required: false

metricChange

Change from current to previous time frame

  • type: String
  • required: false

changePolarity

Determines if the metricChange is bad or good

  • type: Number
  • required: true

trendIcon

Whether trend is up, down, or neutral (no change)

  • type: typeof GenericIcon
  • required: false

trendRange

A description of the time period involved in the calculation, determined internally by the MetricsProvider

  • type: string
  • required: false

hasError

Will display a warning icon instead of metric value if true

  • type: Boolean
  • required: false

errorMessage

Message to be displayed if the API request fails

  • type: String
  • required: false

Included Components

The MetricCardContainer is a parent component which contains one or more instances of MetricCard.

Only MetricCardContainer is exported for use.

Exports

Types

  • MetricCardDef
  • MetricCardDisplayValue
  • MetricCardContainerOptions

Enums

  • MetricCardSize
  • MetricCardType

Usage

<template>
  <MetricCardContainer
    v-bind="metricCardOptions"
  />
</template>
<script setup lang="ts">
import { MetricCardType, MetricCardSize, MetricCardContainer } from '@kong-ui-public/metric-cards'
import '@kong-ui-public/metric-cards/dist/style.css'

const metricCardOptions = {
  cards: [
    {
      cardType: MetricCardType.TRAFFIC,
      currentValue: 192895156,
      previousValue: 236609609,
      title: 'Number of Requests',
      titleTag: 'h3',
      description: 'Requests sent throgh all data plane nodes'
      increaseIsBad: false,
      cardSize: MetricCardSize.Large,
      trendRange: 'vs previous 7 days'
    },
  ],
  loading: false,
  hasTrendAccess: true,
  fallbackDisplayText: 'Not available',
}
</script>