1- # vertical-timeline-component-react
1+ <div id =" top " >
2+ <h1 >vertical-timeline-component-react
3+ <img src =" https://cdn.iconscout.com/icon/free/png-256/typescript-1174965.png " width =" 25 " height =" 25 " />
4+ </h1 >
5+
6+ <p >A simple component to generate a responsive vertical timeline</p >
7+ </div >
28
3- A simple component to generate a responsive vertical timeline
49![ Vertical Timeline Component React] ( https://i.imgur.com/KBqLIlK.png ' How to see vertical-timeline-component-react ')
510
611## Status
712
8- [](https://coveralls.io/github/Proskynete/vertical-timeline-component-react?branch=unit-tests) [](https://www.npmjs.com/package/vertical-timeline-component-react) [](https://travis-ci.org/Proskynete/vertical-timeline-component-react) [](https://david-dm.org/proskynete/vertical-timeline-component-react) [](https://david-dm.org/proskynete/vertical-timeline-component-react?type=dev) [](https://david-dm.org/proskynete/vertical-timeline-component-react?type=peer)
9-
10- ## Getting started
11-
13+ ![ PRs welcome] ( https://img.shields.io/badge/PRs-welcome-green ) [ ![ Coverage Status] ( https://coveralls.io/repos/github/Proskynete/vertical-timeline-component-react/badge.svg?branch=unit-tests )] ( https://coveralls.io/github/Proskynete/vertical-timeline-component-react?branch=unit-tests ) [ ![ Version] ( https://img.shields.io/npm/v/vertical-timeline-component-react.svg )] ( https://www.npmjs.com/package/vertical-timeline-component-react ) [ ![ Build Status] ( https://travis-ci.org/Proskynete/vertical-timeline-component-react.svg?branch=master )] ( https://travis-ci.org/Proskynete/vertical-timeline-component-react ) [ ![ Package Quality] ( https://packagequality.com/shield/vertical-timeline-component-react.svg )] ( https://packagequality.com/#?package=vertical-timeline-component-react )
14+
15+ <br />
16+ <br />
17+
18+ <details >
19+ <summary >Table of contents</summary >
20+ <ol >
21+ <li>
22+ <a href="#getting-started">Getting started</a>
23+ </li>
24+ <li>
25+ <a href="#api-documentation">API Documentation</a>
26+ <ul>
27+ <li><a href="#timeline">Timeline</a></li>
28+ <li><a href="#container">Container</a></li>
29+ <li><a href="#year-content">YearContent</a></li>
30+ <li><a href="#body-content">BodyContent</a></li>
31+ <li><a href="#section">Section</a></li>
32+ <li><a href="#description">Description</a></li>
33+ </ul>
34+ </li>
35+ <li><a href="#how-to-use">How to use it</a></li>
36+ <li><a href="#contributors">Contributors</a></li>
37+ </ol >
38+ </details >
39+
40+ <h2 id =" getting-started " >Getting started</h2 >
1241To install as npm dependency
1342
1443``` sh
1544npm install --save vertical-timeline-component-react
1645```
1746
18- ## API Documentation
47+ <p align =" right " ><a href =" #top " >🔝</a ></p >
48+
49+ <h2 id =" api-documentation " >API Documentation</h2 >
1950
20- ### Timeline
51+ < h3 id = " timeline " > Timeline</ h3 >
2152
2253This is the wrapper component that creates the vertical timeline.
2354
@@ -29,22 +60,23 @@ This is the wrapper component that creates the vertical timeline.
2960
3061- Props
3162
32- | name | Type | Required | Values Allowed | default values | Description |
33- | ---------- | ------ | -------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
34- | theme | object | false | colors | { yearColor: "#888888 ", lineColor: "#c5c5c5", dotColor: "#c5c5c5", borderDotColor: "#ffffff", titleColor: "#cccccc", subtitleColor: "#888888 ", textColor: "#cccccc" } | Set colors in all components |
35- | lang | node | false | ` en ` , ` es ` , ` de ` or ` zh_CN ` | ` en ` | Change the language ` from ` and ` to ` texts and change the format in the dates |
36- | dateFormat | string | false | ` L ` , ` l ` or ` ll ` | ` L ` | Change the presentation format of dates |
63+ | name | Type | Required | Values Allowed | default values | Description |
64+ | ---------- | ------ | -------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
65+ | theme | object | false | colors | { yearColor: "#888888 ", lineColor: "#c5c5c5", dotColor: "#c5c5c5", borderDotColor: "#ffffff", titleColor: "#cccccc", subtitleColor: "#888888 ", textColor: "#cccccc" } | Set colors in all components |
66+ | lang | string | false | ` en ` , ` es ` , ` de ` , ` tr ` or ` zh_CN ` | ` en ` | Change the language ` from ` and ` to ` texts and change the format in the dates |
67+ | dateFormat | string | false | ` only-number ` , ` short ` , ` with-weekday ` or ` full ` | ` only-number ` | Change the presentation format of dates |
3768
38- ` dateFormat ` : Receive only one of three options. (The options are same the [ moment.js] ( https://momentjs.com/ ) using).
69+ ` dateFormat ` : Receive only one of four options (The options are same the [ moment.js] ( https://momentjs.com/ ) using)
3970
40- | | ` L ` | ` l ` | ` ll ` |
41- | :---:| ---| ---| ---|
42- | English(` en ` )| ` MM/DD/YYYY ` | ` M/D/YYYY ` | ` MMM DD, YYYY ` |
43- | Spanish(` es ` )| ` DD/MM/YYYY ` | ` D/M/YYYY ` | ` DD de MMM, YYYY ` |
44- | German(` de ` ) | ` DD.MM.YYYY ` | ` D.M.YYYY ` | ` DD. MMM YYYY ` |
45- | Simplified Chinese(` zh_CN ` )| ` YYYY 年 MM 月 DD 日 ` | ` YYYY 年 M 月 D 日 ` | ` YYYY 年MMM DD 日 ` |
71+ | | ` only-number ` | ` short ` | ` with-weekday ` | ` full ` |
72+ | :--------------------------: | ------------- | ---------------- | ----------------------- | ------------------------------ |
73+ | English (` en ` ) | ` MM/D/YYYY ` | ` MMM DD, YYYY ` | ` ddd, MMM DD, YYYY ` | ` dddd, MMMM DD, YYYY ` |
74+ | Spanish (` es ` ) | ` D/MM/YYYY ` | ` DD MMM YYYY ` | ` ddd, DD [de] MMM YYYY ` | ` dddd, DD [de] MMMM [de] YYYY ` |
75+ | German (` de ` ) | ` D.MM.YYYY ` | ` DD.MMM.YYYY ` | ` ddd., DD. MMM. YYYY ` | ` dddd, DD. MMMM YYYY ` |
76+ | Turk (` tr ` ) | ` DD.MM.YYYY ` | ` DD MMM YYYY ` | ` DD MMM YYYY ddd ` | ` DD MMMM YYYY dddd ` |
77+ | Simplified Chinese (` zh_CN ` ) | ` YYYY/MM/D ` | ` YYYY年MM月DD日 ` | ` YYYY年MMM月DD日 ` | ` YYYY年MM月DD日dddd ` |
4678
47- ### Container
79+ < h3 id = " container " > Container</ h3 >
4880
4981Each event in the timeline will be represented by the ` Content ` component. This component receive only two children's, the first is ` YearContent ` and the second is ` BodyContent ` . There can be multiple repeating instances of this component inside ` Timeline ` wrapper.
5082
@@ -54,9 +86,9 @@ Each event in the timeline will be represented by the `Content` component. This
5486| ------------------ | -------- | ------------------------------- |
5587| 2 | true | ` YearContent ` and ` BodyContent ` |
5688
57- ### YearContent
89+ < h3 id = " year-content " > YearContent</ h3 >
5890
59- For each ` Container ` you need ` YearContent ` (like firts children) since with this component you mark the events in the given year.
91+ For each ` Container ` you need ` YearContent ` (like first children) since with this component you mark the events in the given year.
6092
6193- Props
6294
@@ -66,7 +98,7 @@ For each `Container` you need `YearContent` (like firts children) since with thi
6698| endDate | string | false | ` YYYY/MM/DD ` - ` YYYY/MM ` - ` YYYY ` | does not apply | The date of the end of the content or contents |
6799| currentYear | boolean | false | ` true ` or ` false ` | current year | The value is the current year, it is recommended to use it in the last Container |
68100
69- ### BodyContent
101+ < h3 id = " body-content " > BodyContent</ h3 >
70102
71103For each ` Container ` you need ` ContentBody ` (like second children). This component will be the container of the one or more ` Sections ` .
72104
@@ -76,7 +108,7 @@ For each `Container` you need `ContentBody` (like second children). This compone
76108| ------------------ | -------------------------------------------------- | ------------------------- |
77109| Many | At least the first ` Section ` component is required | Only ` Section ` components |
78110
79- ### Section
111+ < h3 id = " section " > Section</ h3 >
80112
81113This component is the container for one or more ` Description ` .
82114
@@ -92,7 +124,7 @@ This component is the container for one or more `Description`.
92124| ----- | ------ | -------- | ----------------------------- |
93125| title | string | true | It's the title of any section |
94126
95- ### Description
127+ < h3 id = " description " > Description</ h3 >
96128
97129This component can be the text of the description or a subtitle
98130
@@ -103,7 +135,9 @@ This component can be the text of the description or a subtitle
103135| variant | string | false | ` subtitle ` or ` description ` | ` description ` | Transform the format of the text |
104136| text | string | true | Any text | does not apply | Show the description of the ` Section ` |
105137
106- ## How to use it
138+ <p align =" right " ><a href =" #top " >🔝</a ></p >
139+
140+ <h2 id =" how-to-use " >How to use it</h2 >
107141
108142The following snippet will show you how to use the library:
109143
@@ -132,7 +166,7 @@ const customTheme = {
132166class Main extends Component {
133167 render () {
134168 return (
135- < Timeline theme= {customTheme} dateFormat= ' ll ' >
169+ < Timeline theme= {customTheme} dateFormat= ' full ' >
136170 < Container>
137171 < YearContent startDate= ' 2020/07/01' currentYear / >
138172 < BodyContent>
@@ -158,47 +192,59 @@ class Main extends Component {
158192
159193``` js
160194import {
161- Timeline ,
162- Container ,
163- YearContent ,
164- BodyContent ,
165- Section ,
166- Description ,
195+ Timeline ,
196+ Container ,
197+ YearContent ,
198+ BodyContent ,
199+ Section ,
200+ Description ,
167201} from ' vertical-timeline-component-react' ;
168202
169203const Main = () => {
170- const customTheme = {
171- yearColor: ' #405b73' ,
172- lineColor: ' #d0cdc4' ,
173- dotColor: ' #262626' ,
174- borderDotColor: ' #d0cdc4' ,
175- titleColor: ' #405b73' ,
176- subtitleColor: ' #bf9765' ,
177- textColor: ' #262626' ,
178- };
179-
180- return (
181- < Timeline theme= {customTheme} dateFormat= ' ll ' >
182- < Container>
183- < YearContent startDate= ' 2020/07/01' currentYear / >
184- < BodyContent>
185- < Section title= ' Title' >
186- < Description variant= ' subtitle' text= ' Subtitle' / >
187- < Description text= ' Description' / >
188- < Description text= ' Another description' / >
189- < / Section>
190-
191- < Section title= ' Another title' >
192- < Description text= ' Description' / >
193- < Description text= ' Another description' / >
194- < / Section>
195- < / BodyContent>
196- < / Container>
197- < / Timeline>
198- );
204+ const customTheme = {
205+ yearColor: ' #405b73' ,
206+ lineColor: ' #d0cdc4' ,
207+ dotColor: ' #262626' ,
208+ borderDotColor: ' #d0cdc4' ,
209+ titleColor: ' #405b73' ,
210+ subtitleColor: ' #bf9765' ,
211+ textColor: ' #262626' ,
212+ };
213+
214+ return (
215+ < Timeline theme= {customTheme} dateFormat= ' full ' >
216+ < Container>
217+ < YearContent startDate= ' 2020/07/01' currentYear / >
218+ < BodyContent>
219+ < Section title= ' Title' >
220+ < Description variant= ' subtitle' text= ' Subtitle' / >
221+ < Description text= ' Description' / >
222+ < Description text= ' Another description' / >
223+ < / Section>
224+
225+ < Section title= ' Another title' >
226+ < Description text= ' Description' / >
227+ < Description text= ' Another description' / >
228+ < / Section>
229+ < / BodyContent>
230+ < / Container>
231+ < / Timeline>
232+ );
199233};
200234```
201235
202- ## License
236+ <p align =" right " ><a href =" #top " >🔝</a ></p >
237+
238+ <h2 id =" contributors " >Contributors</h2 >
239+
240+ <a href =" https://github.com/Proskynete/vertical-timeline-component-react/graphs/contributors " >
241+ <img src =" https://contrib.rocks/image?repo=Proskynete/vertical-timeline-component-react " />
242+ </a >
243+
244+ <p align =" right " ><a href =" #top " >🔝</a ></p >
245+
246+ <h2 id =" license " >License</h2 >
203247
204248MIT
249+
250+ <p align =" right " ><a href =" #top " >🔝</a ></p >
0 commit comments