11# vertical-timeline-component-react
22
33A simple component to generate a responsive vertical timeline
4-
5- ![ Vertical Timeline Component React] ( https://i.imgur.com/QmqtTJc.png " How to see vertical-timeline-component-react ")
4+ ![ Vertical Timeline Component React] ( https://i.imgur.com/JXdOHYV.png ' How to see vertical-timeline-component-react ')
65
76## Status
87
@@ -36,33 +35,37 @@ Each event in the timeline will be represented by the `Content` component. There
3635
3736For each ` Content ` you need ` ContentYear ` since with this component you mark the events in the given year.
3837
39- | Name | Type | Required | Description |
40- | ------ | ------ | ------ | ------ |
41- | Year | String | True | The year for each content |
38+ | Name | Type | Required | Values Allowed | Description |
39+ | ----------- | ---------------- | -------- | ------------------------ | ------------------------------------------------- |
40+ | startMonth | string or number | false | from 0 to 12 | The month of the start of the content or contents |
41+ | monthType | string | false | text or number (default) | Type of how to show the month |
42+ | startDay | string | false | from 1 to 31 | The day of the start of the content or contents |
43+ | startYear | string | true | any year | The year of the start of the content or contents |
44+ | currentYear | boolean | false | false (default) | When the content is still being made |
4245
4346### ContentBody
4447
4548For each ` Content ` you need ` ContentBody ` , because with this component you describe the events that occurred in that year using ` Description ` component.
4649
47- | Name | Type | Required | Description |
48- | ------ | ------ | ------ | ------ |
49- | Title | String | True | Show the title for the events |
50- | Children | Node | True | It is necessary to use the description component. |
50+ | Name | Type | Required | Description |
51+ | -------- | ------ | -------- | ------------------------------------------- ------ |
52+ | Title | String | True | Show the title for the events |
53+ | Children | Node | True | It is necessary to use the description component. |
5154
5255### Description
5356
5457With this component you describe the events one for one.
5558
56- | Name | Type | Required | Description |
57- | ------ | ------ | ------ | ------ |
58- | Text | String | True | Describe the event |
59- | Optional | String | False | You can this props for use a optional text |
59+ | Name | Type | Required | Description |
60+ | -------- | ------ | -------- | ------------------------------------ ------ |
61+ | Text | String | True | Describe the event |
62+ | Optional | String | False | You can this props for use a optional text |
6063
6164## How to use it
6265
6366The following snippet will show you how to use the library:
6467
65- *** Using class components:* **
68+ ** _ Using class components:_ **
6669
6770``` js
6871import {
@@ -74,25 +77,37 @@ import {
7477} from ' vertical-timeline-component-react' ;
7578
7679class Main extends Component {
77- render () {
78- return (
79- < Timeline>
80- < Content>
81- < ContentYear year= " 2018" / >
82- < ContentBody title= " Amazing Title" >
83- < Description text= " I'm an amazing event" optional= " I'm an amazing optional text" / >
84- < / ContentBody>
85- < / Content>
86- < Content>
87- ...
88- < / Content>
89- < / Timeline>
90- )
91- }
80+ render () {
81+ return (
82+ < Timeline>
83+ < Content>
84+ < ContentYear
85+ startMonth= " 12"
86+ monthType= " text"
87+ startDay= " 24"
88+ startYear= " 2016"
89+ currentYear
90+ / >
91+ < ContentBody title= " Amazing Title" >
92+ < Description
93+ text= " I'm an amazing event"
94+ optional= " I'm an amazing optional text"
95+ / >
96+ < Description
97+ text= " I'm an amazing event"
98+ optional= " I'm another amazing optional text"
99+ / >
100+ < Description text= " I'm an amazing event" / >
101+ < / ContentBody>
102+ < / Content>
103+ < Content> ... < / Content>
104+ < / Timeline>
105+ );
106+ }
92107}
93108```
94109
95- *** Using function components:* **
110+ ** _ Using function components:_ **
96111
97112``` js
98113import {
@@ -104,20 +119,32 @@ import {
104119} from ' vertical-timeline-component-react' ;
105120
106121const Main = () => (
107- < Timeline>
108- < Content>
109- < ContentYear year= " 2018" / >
110- < ContentBody title= " Amazing Title" >
111- < Description text= " I'm an amazing event" optional= " I'm an amazing optional text" / >
112- < / ContentBody>
113- < / Content>
114- < Content>
115- ...
116- < / Content>
117- < / Timeline>
122+ < Timeline>
123+ < Content>
124+ < ContentYear
125+ startMonth= " 12"
126+ monthType= " text"
127+ startDay= " 24"
128+ startYear= " 2016"
129+ currentYear
130+ / >
131+ < ContentBody title= " Amazing Title" >
132+ < Description
133+ text= " I'm an amazing event"
134+ optional= " I'm an amazing optional text"
135+ / >
136+ < Description
137+ text= " I'm an amazing event"
138+ optional= " I'm another amazing optional text"
139+ / >
140+ < Description text= " I'm an amazing event" / >
141+ < / ContentBody>
142+ < / Content>
143+ < Content> ... < / Content>
144+ < / Timeline>
118145);
119146```
120147
121148## License
122149
123- MIT
150+ MIT
0 commit comments