• Stars
    star
    192
  • Rank 202,019 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple and beautiful card component with an elegant spark line, for VueJS.

Simple and beautiful card component with an elegant spark line, for VueJS.

Build Status Coverage Status npm version License

Demo

Live demo of the component can be found here.

Installation

npm i -S vue-info-card

Usage

After the installation, the component can be used by passing the appropriate props for displaying the data and messages. A sample usage within a single file component is as follows:

<template>
  <div>
    <info-card :frontType="'graph'"
      :frontTitle="front.title"
      :frontData="front.graphData"
      :backTitle="back.title"
      :backData="back.message" />
  </div>
</template>

<script>
import InfoCard from 'vue-info-card';

export default {
  components: {
    InfoCard,
  },
  data() {
    return {
      front: {
        title: 'Daily Conversion Value',
        graphData: [3, 2, 5, 9, 5, 10, 3, 5, 0, 0, 1, 8, 2, 9, 0],
      },
      back: {
        title: 'Monthly Summary',
        message: 'Your average daily conversion value for this month is <b>50.4$</b>. It is below the average of the last six months.',
      },
    };
  },
};
</script>

Props

There are basically three different props for each faces of the card. A face requires a type, such as graph or text, a title, and a data to display in the body of the card. The props are as follows:

prop Type Optional? Default Description
frontType String βœ… 'text' Type of the front face of the card. Available options are graph or text.
frontTitle String βœ… 'Default Card Title' Title of the front face of the card.
frontData String or Array ❌ Data that will be displayed on the front face of the card. If frontType is set to graph, this must be an array; otherwise, a string.
frontTrendGradients Array βœ… ['#4facfe', '#00f2fe'] Gradient that will be used on the spark line, expected to be an array of color hexas as strings.
backType String βœ… 'text' Type of the back face of the card. Available options are graph or text.
backTitle String βœ… 'Default Card Title' Title of the back face of the card.
backData String or Array ❌ Data that will be displayed on the back face of the card. If frontType is set to graph, this must be an array; otherwise, a string.
backTrendGradients Array βœ… ['#4facfe', '#00f2fe'] Gradient that will be used on the spark line, expected to be an array of color hexas as strings.

Note that both frontData and backData props accept HTML as input, which means you can inject elements to the card body directly.

Credits

The component is based on two main features: spark line and flip effect. The spark line is created with the amazing vuetrend component, which creates cool and customizable graphs. The flipping effect is implemented in pure CSS, and influenced from the tutorial here.

Browser Support

The component supports all of the modern browsers, with least versions: Firefox 37, Chrome 42, Safari 8, Opera 29, and IE 10.

License

The project is under MIT License.

More Repositories

1

devo

A Chrome and Firefox extension that displays GitHub Trending, Hacker News, Product Hunt and Designer News on every new tab.
Vue
405
star
2

boardz

Create Pinterest-like boards with pure CSS, in less than 1kB.
HTML
36
star
3

nginx-subdomain-generator-script

A bash script that is creating subdomain with given parameters with Nginx in the directory /var/www
Shell
14
star
4

sorting-benchmark

A basic benchmarking for insertion sort, merge sort and quicksort in C++.
C++
6
star
5

noise-removal

Sample Python code for Mean & Median filters and sample convolution implementation.
Python
5
star
6

unblock-me-solver

A C++ based solution by using both BFS and DFS for the game Unblock Me.
C++
4
star
7

wikipedia-uncensored

This is a Chrome extension that replaces "wikipedia.org" urls with "0wikipedia.org" in order to work around the Wikipedia censorship in Turkey.
JavaScript
4
star
8

bootools

BooTools is a simple set of tools that are useful to digital marketers and SEO specialists.
PHP
2
star
9

vite-tailwind-skeleton

A simple skeleton project that contains the setup with Vite, TailwindCSS and PurgeCSS.
HTML
1
star
10

gh-api

A simple microservice for converting GitHub Trending page to JSON format.
JavaScript
1
star
11

hn-parser

An NPM module to parse Hacker News main page.
HTML
1
star
12

html-starter

A simple CLI app to create an HTML skeleton project.
JavaScript
1
star
13

gh-trending-parser

Simple package that parses GitHub Trending page and returns a well-formatted JSON, based on cheerio.
HTML
1
star
14

counterful

A JavaScript script that counts character, words and sentences in a given text.
JavaScript
1
star
15

imgur-opener

A Chrome extension to allow Imgur based images to be displayed.
JavaScript
1
star
16

laravel-base

A Docker image that can be used as a base for Laravel projects, with PHP 7.2, Composer, Git and all the extensions.
1
star
17

bash-profile

My very own .bash-profile file that contains some useful aliases.
Shell
1
star
18

gcp-helm-helmfile

A simple dockerfile that includes gcp, helm and helmfile cli tools
Dockerfile
1
star
19

word-multiplier

A JavaScript script that generates different combinations of given keyword groups by concatenation.
JavaScript
1
star
20

hn-api

A simple microservice that acts as a HackerNews API, by simply parsing the main page.
JavaScript
1
star
21

frank

Frank is a fast and easy-to-use one-page static site generator based on a given Markdown file.
Go
1
star