Skip to content

Commit 062c436

Browse files
committed
docs: update readme
1 parent afb9dd9 commit 062c436

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

README.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,17 @@ const items: TimelineItemsProps = [
4949

5050
The available properties of the `Timeline` component:
5151

52-
| Property | Type | Description | Default |
53-
| :---------------------- | :-------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | :-------------- |
54-
| `items` | [`TimelineItemsProps`](#timelineitemsprops) | Array of timeline items | |
55-
| `positioning?` | `'alternating' \| 'left' \| 'right'` | How the items should be positioned relative to the timeline | `'alternating'` |
56-
| `gap?` | `number` | The horizontal gap between timeline items | 50 (`px`) |
57-
| `offset?` | `{ left?: number; right?: number } \| number` | Offset left or right items from the top (default offset when passing just a `number`: `right`) | 50 (`px`) |
58-
| `minMarkerGap?` | `number` | The minimum gap markers will have between each other | 50 (`px`) |
59-
| `defaultPointerOffset?` | `number` | The regular top offset pointers have to their item card | 40 (`px`) |
60-
| `dateLocal?` | `Local` | Date locale | |
61-
| `dateFormat?` | `string` | Specific date format according to date-fns [specification](https://date-fns.org/v2.29.3/docs/format). Ignored when passing a `string` as date | `'P'` |
62-
| `customMarker?` | `ReactElement` | Custom maker element replacing the default | |
63-
| `customPointer?` | `ReactElement` | Custom pointer element replacing the default | |
64-
| `styleConfig?` | [`StyleConfig`](#styleconfig) | Style config object for customizing timeline by setting css custom properties | |
65-
| `className?` | `string` | Additional class name | |
52+
| Property | Type | Description | Default |
53+
| :--------------- | :------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------- | :-------------- |
54+
| `items` | [`TimelineItemsProps`](#timelineitemsprops) | Array of timeline items | |
55+
| `positioning?` | `'alternating' \| 'left' \| 'right'` | How the items should be positioned relative to the timeline | `'alternating'` |
56+
| `minMarkerGap?` | `number` | The minimum gap markers will have between each other | 50 (`px`) |
57+
| `dateLocal?` | `Local` | Date locale | |
58+
| `dateFormat?` | `string` | Specific date format according to date-fns [specification](https://date-fns.org/v2.29.3/docs/format). Ignored when passing a `string` as date | `'P'` |
59+
| `customMarker?` | `ReactElement` | Custom maker element replacing the default | |
60+
| `customPointer?` | `ReactElement` | Custom pointer element replacing the default | |
61+
| `styleConfig?` | [`StyleConfig`](#styleconfig) | Style config object for customizing timeline by setting css custom properties | |
62+
| `className?` | `string` | Additional class name | |
6663

6764
### TimelineItemsProps
6865

@@ -89,6 +86,11 @@ The style can either be passed as a javascript object...
8986
width?: string;
9087
color?: string;
9188
};
89+
gap?: string;
90+
offset?: {
91+
left?: string;
92+
right?: string;
93+
};
9294
marker?: {
9395
size?: string;
9496
color?: string;
@@ -97,6 +99,7 @@ The style can either be passed as a javascript object...
9799
pointer?: {
98100
height?: string;
99101
width?: string;
102+
offset?: string;
100103
};
101104
card?: {
102105
background?: string;
@@ -119,11 +122,15 @@ The style can either be passed as a javascript object...
119122
--marker-radius: 50%;
120123
--pointer-height: 2rem;
121124
--pointer-width: 1rem;
125+
--pointer-offset: 5rem;
122126
--card-background: whitesmoke;
123127
--card-radius: 0.1rem;
124128
--card-offset: 1rem;
125129
--card-shadow: unset;
126130
--card-padding: 1rem;
131+
--gap: 1rem;
132+
--offset-left: 0;
133+
--offset-right: 5rem;
127134
}
128135
```
129136

src/models/style.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export type StyleConfig = {
77
};
88
gap?: string;
99
offset?: {
10-
left: string;
11-
right: string;
10+
left?: string;
11+
right?: string;
1212
};
1313
marker?: {
1414
size?: string;

0 commit comments

Comments
 (0)