Code Monkey home page Code Monkey logo

vue-cute-timeline's Introduction

vue-cute-timeline

NPM version NPM downloads CircleCI

DEMO

Introduction

A cute timeline component for Vue.js.

Install

yarn add vue-cute-timeline --save

Usage

<template>
  <timeline>
    <timeline-title>title</timeline-title>
    <timeline-item bg-color="#9dd8e0">item1</timeline-item>
    <timeline-item :hollow="true">item2</timeline-item>
  </timeline>
</template>

<script>
import { Timeline, TimelineItem, TimelineTitle } from 'vue-cute-timeline'

export default {
  components: {
    Timeline,
    TimelineItem,
    TimelineTitle
  }
}
</script>

API

<timeline> props

It will be better to use hyphenated attributes instead of camelcase attributes. The discussion explained why.

  • timeline-theme

    The theme color of the timeline component.

    Set the line's and circle's color.

    Type: string
    Default: #dbdde0
    
  • timeline-bg

    The background color of the timeline circle component (for hollow and others if needed).

    Set the hollow circle's and other timeline symbol's default background color.

    Type: string
    Default: #dbdde0
    

<timeline-item> / <timeline-title> props

  • bg-color

    Set the circle's and the circle's border color.

    Type: string
    Default: #dbdde0
    
  • line-color

    Set only the circle's border color.

    Type: string
    Default: #dbdde0
    
  • hollow

    Control whether the circle is hollow or not. _Note** When hollow cannot be used together with bg-color, unless you wish to change the hollow background color.

    Type: boolean
    Default: false
    
  • font-color

    Set the timeline item or title font color. Or you can set font color by add a className, as the content of the timeline item/title is a slot.

    Type: string
    Default: #37414a
    
    • icon-size

    Set the timeline item or title icon size. Control the size of the circle or of the image set using slots="others".

    Type: string
    Default: ''
    

Slots

  • others

    Don't like the circle? You can set it to a image, iconfont or anything you want.

    <timeline-item>
      <img
          src="https://user-images.githubusercontent.com/12069729/36057805-80cfc3d2-0e4e-11e8-8851-6fda091ff389.png"
          class="icon-heart"
          slot="others"
      />
    </timeline-item>

License

MIT © luyilin

minemine.cc · GitHub @luyilin · Twitter @luyilin12

vue-cute-timeline's People

Contributors

luyilin avatar henriqueslaporta avatar mracos avatar hwen avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.