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

lv-react-horizontal-timeline

v2.1.6

Published

Horizontal timeline component

Downloads

15

Readme

horizontal-timeline

A React component to create horizontal timelines

Attention: this dependency requires Material-UI

Installation

npm install --save lv-react-horizontal-timeline

or

yarn add lv-react-horizontal-timeline

Usage

The following snippet generates the timeline you see in the first screenshot - react-icons required

To make it like the second screenshot set the property variant to "simple", on the Timeline component, and to make it like the third one set it to "small"

import { Timeline, TimelineEvent } from '@mailtop/horizontal-timeline'
import { FaBug, FaRegCalendarCheck, FaRegFileAlt } from 'react-icons/fa'

<Timeline minEvents={5} placeholder>
  <TimelineEvent
    icon={FaRegFileAlt}
    title='Em rascunho'
    subtitle='26/03/2019 09:51'
  />
  <TimelineEvent
    color='#87a2c7'
    icon={FaRegCalendarCheck}
    title='Agendado'
    subtitle='26/03/2019 09:51'
  />
  <TimelineEvent
    color='#9c2919'
    icon={FaBug}
    title='Erro'
    subtitle='26/03/2019 09:51'
    action={{
      label: 'Ver detalhes...',
      onClick: () => window.alert('Erro!')
    }}
  />
</Timeline>

API

Timeline

Renders a div with the same width as the parent element and creates a horizontal scrollbar according to the number of events

Props:
# variant: defines what type of Timeline will be rendered. The screenshots above shows the default, simple and small respectively. When small or simple are choose, the event title and subtitle are shown on a tooltip and the action, if set, is fired when you click the circle
# height: set the size of the component. Default values, accordingly to variant:
   -small: 95px
   -simple: 135px
   -default: 265px
# minEvents: used to render placeholders for events, if placeholder is set to true, as shown in the screenshots above
# maxEvents: limit the number of events showed on screen
# placeholder: create the placholders when minEvents is defined

TimelineEvent

Renders events inside the Timeline wrapper. Any number of these can be created*

Props
# color: set the color of the event. Default value: #e0e0e0
# icon: renders the icon that identifies the event
# title: renders the main text below the event; if a string is provided, you can alter it's properties with the prop titleProps OR you can pass an element type - a React component or a HTML component - fully customized
# titleProps: an object containing any of the Typography props from @material-ui
# subtitle: renders the secondary text below the event; if a string is provided, you can alter it's properties with the prop subtitleProps OR you can pass an element type - a React component or a HTML element - fully customized
# subtitleProps: an object containing any of the Typography props from @material-ui
# action: the action may be an element type - a React component or a HTML element - OR an object with these two properties:
   -label: the text inside the button showed below the event
   -onClick: the action fired when the user click the button or the event, if simple or small is set to true in the Timeline component

* if maxEvents is set on the Timeline component, the number of events showed on screen will be limited to that ammount

Development

  1. Clone the repository git clone [email protected]:luiisvieira/react-horizontal-timeline.git
  2. Run yarn start
  3. Access http://localhost:3001*

* the example page is located in /examples/src/App.js