๐ Comprehensive documentation of all supported properties
This document covers every prop, configuration option, and interface in React Chrono
These are the essential properties that define the basic behavior of your timeline.
| Property | Type | Default | Required | Description |
|---|
items | TimelineItem[] | [] | โ
| Array of timeline items to display |
mode | TimelineMode | 'alternating' | โ | Timeline display mode |
children | ReactNode | ReactNode[] | - | โ | Custom React content for timeline cards |
theme | Theme | {} | โ | Visual theme configuration |
activeItemIndex | number | 0 | โ | Index of initially active timeline item |
allowDynamicUpdate | boolean | false | โ | Enable dynamic updates to timeline items |
id | string | - | โ | Custom unique identifier for the timeline |
i18n | I18nConfig | - | โ | Internationalization configuration for multi-language support |
darkMode | DarkModeConfig | - | โ | Dark mode configuration and toggle options |
type TimelineMode =
| 'horizontal' // Classic left-to-right layout
| 'vertical' // Top-to-bottom layout
| 'alternating' // Cards alternate sides (default)
| 'horizontal-all' // Show all cards simultaneously
Control the size, positioning, and responsive behavior of your timeline.
layout?: {
cardWidth?: number;
cardHeight?: number | 'auto';
pointSize?: number;
lineWidth?: number;
itemWidth?: number;
timelineHeight?: number | string;
responsive?: {
breakpoint?: number;
enabled?: boolean;
};
positioning?: {
cardPosition?: 'top' | 'bottom';
flipLayout?: boolean;
};
}
| Property | Type | Default | Description |
|---|
cardWidth | number | 450 | Maximum width of timeline cards in pixels |
cardHeight | number | 'auto' | 200 | Height of timeline cards in pixels, or 'auto' for automatic sizing based on content |
pointSize | number | 16 | Size of timeline points/circles in pixels |
lineWidth | number | 3 | Width of the timeline track line in pixels |
itemWidth | number | 200 | Width of each timeline section in horizontal mode (px) |
timelineHeight | number | string | - | Fixed height for the timeline container |
| Property | Type | Default | Description |
|---|
responsive.breakpoint | number | 768 | Viewport width breakpoint for mode switching (px) |
responsive.enabled | boolean | true | Enable automatic responsive mode switching |
| Property | Type | Default | Description |
|---|
positioning.cardPosition | 'top' | 'bottom' | - | Card position in horizontal mode |
positioning.flipLayout | boolean | false | Flip layout direction for RTL support |
Configure user interactions and navigation behavior.
interaction?: {
keyboardNavigation?: boolean;
pointClick?: boolean;
autoScroll?: boolean;
focusOnLoad?: boolean;
cardHover?: boolean;
disabled?: boolean;
}
| Property | Type | Default | Description |
|---|
keyboardNavigation | boolean | true | Enable arrow key navigation |
pointClick | boolean | true | Enable clicking on timeline points |
autoScroll | boolean | true | Auto-scroll to active items when selected |
focusOnLoad | boolean | false | Focus active item when timeline loads |
cardHover | boolean | false | Highlight cards on mouse hover |
disabled | boolean | false | Disable all user interactions |
| Keys | Mode | Action |
|---|
โ โ | Horizontal | Navigate between items |
โ โ | Vertical/Alternating | Navigate between items |
Home | All | Jump to first item |
End | All | Jump to last item |
Enter | All | Select focused item |
Escape | All | Exit fullscreen/pause slideshow |
Handle text content, HTML parsing, and semantic structure.
content?: {
allowHTML?: boolean;
readMore?: boolean;
textOverlay?: boolean;
dateFormat?: string;
compactText?: boolean;
semanticTags?: {
title?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'div';
subtitle?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'div';
};
alignment?: {
horizontal?: 'left' | 'center' | 'right' | 'stretch';
vertical?: 'top' | 'center' | 'bottom' | 'stretch';
};
}
| Property | Type | Default | Description |
|---|
allowHTML | boolean | false | Allow HTML parsing in card content |
readMore | boolean | true | Enable "read more" button for long content |
textOverlay | boolean | false | Display text as overlay on media |
dateFormat | string | 'MMM DD, YYYY' | Date format for timeline titles (Day.js format) |
compactText | boolean | false | Use compact text display mode |
Control how text content is aligned within timeline cards.
| Property | Type | Default | Description |
|---|
alignment.horizontal | 'left' | 'center' | 'right' | 'stretch' | 'left' | Horizontal alignment of card content |
alignment.vertical | 'top' | 'center' | 'bottom' | 'stretch' | 'top' | Vertical alignment of card content |
Example:
<Chrono
items={items}
content={{
alignment: {
horizontal: 'center', // Center-align text horizontally
vertical: 'center' // Center-align text vertically
}
}}
/>
| Property | Type | Default | Description |
|---|
semanticTags.title | HTMLTag | 'h3' | HTML tag for timeline item titles |
semanticTags.subtitle | HTMLTag | 'h4' | HTML tag for timeline card subtitles |
'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'div'
Control visual appearance, UI elements, and layout options.
display?: {
borderless?: boolean;
cardsDisabled?: boolean;
pointsDisabled?: boolean;
pointShape?: 'circle' | 'square' | 'diamond';
allCardsVisible?: boolean;
toolbar?: {
enabled?: boolean;
position?: 'top' | 'bottom';
sticky?: boolean;
search?: {
width?: string;
maxWidth?: string;
minWidth?: string;
inputWidth?: string;
inputMaxWidth?: string;
};
};
scrollable?: boolean | {
scrollbar: boolean;
};
}
| Property | Type | Default | Description |
|---|
borderless | boolean | false | Remove borders and shadows from cards |
cardsDisabled | boolean | false | Hide timeline cards completely |
pointsDisabled | boolean | false | Hide timeline points |
pointShape | 'circle' | 'square' | 'diamond' | 'circle' | Shape of timeline points |
allCardsVisible | boolean | false | Show all cards simultaneously in horizontal mode |
| Property | Type | Default | Description |
|---|
toolbar.enabled | boolean | true | Show/hide the toolbar |
toolbar.position | 'top' | 'bottom' | 'top' | Position of the toolbar |
toolbar.sticky | boolean | false | Make toolbar sticky during scroll |
toolbar.search.width | string | - | Default width of search section (CSS length) |
toolbar.search.maxWidth | string | - | Maximum width of search section (CSS length) |
toolbar.search.minWidth | string | - | Minimum width of search section (CSS length) |
toolbar.search.inputWidth | string | - | Width of actual input field (CSS length) |
toolbar.search.inputMaxWidth | string | - | Maximum width of actual input field (CSS length) |
| Property | Type | Default | Description |
|---|
scrollable | boolean | {scrollbar: boolean} | {scrollbar: false} | Enable scrolling for vertical modes |
Configure images, videos, and media handling.
media?: {
height?: number;
align?: 'left' | 'center' | 'right';
fit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
}
| Property | Type | Default | Description |
|---|
height | number | 200 | Minimum height of media elements in pixels |
align | 'left' | 'center' | 'right' | 'left' | Media alignment within cards |
fit | MediaFit | 'cover' | CSS object-fit property for images |
type MediaFit = 'cover' | 'contain' | 'fill' | 'none' | 'scale-down'
Control slideshow functionality and transition effects.
animation?: {
slideshow?: {
enabled?: boolean;
duration?: number;
type?: 'reveal' | 'slide' | 'fade';
autoStart?: boolean;
showProgress?: boolean;
showOverallProgress?: boolean;
};
}
| Property | Type | Default | Description |
|---|
slideshow.enabled | boolean | false | Enable slideshow functionality |
slideshow.duration | number | 2000 | Duration each slide is displayed (milliseconds) |
slideshow.type | SlideshowType | 'fade' | Type of transition animation |
slideshow.autoStart | boolean | false | Auto-start slideshow on load |
slideshow.showProgress | boolean | false | Show progress indicator on cards |
slideshow.showOverallProgress | boolean | true | Show overall progress bar |
type SlideshowType =
| 'reveal' // Cards reveal progressively
| 'slide' // Cards slide in from sides
| 'fade' // Cards fade in/out
Customize CSS classes, fonts, and Google Fonts integration.
style?: {
classNames?: {
card?: string;
cardMedia?: string;
cardSubTitle?: string;
cardText?: string;
cardTitle?: string;
controls?: string;
title?: string;
timelinePoint?: string;
timelineTrack?: string;
};
fontSizes?: {
cardSubtitle?: string;
cardText?: string;
cardTitle?: string;
title?: string;
};
googleFonts?: GoogleFontsConfig;
}
| Property | Description | Target Element |
|---|
classNames.card | Timeline card container | Card wrapper |
classNames.cardMedia | Media within cards | Images/videos |
classNames.cardSubTitle | Card subtitle text | Subtitle element |
classNames.cardText | Card body text | Main content |
classNames.cardTitle | Card title text | Title element |
classNames.controls | Toolbar controls | Control buttons |
classNames.title | Timeline item titles | Point labels |
classNames.timelinePoint | Timeline points | Circle/square points |
classNames.timelineTrack | Timeline line | Main timeline line |
| Property | Type | Default | Description |
|---|
fontSizes.title | string | - | Font size for timeline item titles |
fontSizes.cardTitle | string | - | Font size for card titles |
fontSizes.cardSubtitle | string | - | Font size for card subtitles |
fontSizes.cardText | string | - | Font size for card body text |
googleFonts?: {
fontFamily: string;
elements?: {
title?: FontElement;
cardTitle?: FontElement;
cardSubtitle?: FontElement;
cardText?: FontElement;
controls?: FontElement;
};
weights?: FontWeight[];
display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
preconnect?: boolean;
}
interface FontElement {
weight?: FontWeight;
style?: 'normal' | 'italic';
size?: string;
}
type FontWeight =
| 'thin' | 'extra-light' | 'light' | 'regular' | 'medium'
| 'semi-bold' | 'bold' | 'extra-bold' | 'black'
| 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
| Property | Type | Default | Description |
|---|
fontFamily | string | - | Google Fonts family name |
elements | FontElements | - | Font configuration for different elements |
weights | FontWeight[] | - | Additional font weights to load |
display | FontDisplay | 'swap' | Font display strategy |
preconnect | boolean | true | Preconnect to Google Fonts for faster loading |
Customize labels, ARIA attributes, and screen reader support.
accessibility?: {
buttonTexts?: {
first?: string;
last?: string;
next?: string;
previous?: string;
play?: string;
stop?: string;
};
search?: {
placeholder?: string;
ariaLabel?: string;
clearLabel?: string;
};
}
| Property | Type | Default | Description |
|---|
buttonTexts.first | string | 'Go to first item' | First button label |
buttonTexts.last | string | 'Go to last item' | Last button label |
buttonTexts.next | string | 'Next item' | Next button label |
buttonTexts.previous | string | 'Previous item' | Previous button label |
buttonTexts.play | string | 'Start slideshow' | Play button label |
buttonTexts.stop | string | 'Stop slideshow' | Stop button label |
| Property | Type | Default | Description |
|---|
search.placeholder | string | 'Search...' | Search input placeholder |
search.ariaLabel | string | 'Search timeline' | ARIA label for search input |
search.clearLabel | string | 'Clear search' | Clear search button label |
Complete internationalization support for all user-facing text in the timeline component.
i18n?: {
texts?: TimelineI18nConfig;
locale?: string;
direction?: 'ltr' | 'rtl';
}
The texts configuration provides internationalization support for all timeline text elements:
i18n: {
texts: {
navigation: {
first: 'Go to first item',
last: 'Go to last item',
next: 'Next item',
previous: 'Previous item',
play: 'Start slideshow',
stop: 'Stop slideshow',
},
search: {
placeholder: 'Search Timeline',
ariaLabel: 'Search timeline content',
clearLabel: 'Clear Search',
nextMatch: 'Next Match (Enter)',
previousMatch: 'Previous Match (Shift+Enter)',
resultsCount: '{current} of {total}',
noResults: 'No results found',
},
theme: {
darkMode: 'Switch to dark mode',
lightMode: 'Switch to light mode',
toggleTheme: 'Toggle theme',
},
fullscreen: {
enterFullscreen: 'Enter fullscreen',
exitFullscreen: 'Exit fullscreen',
notSupported: 'Fullscreen not supported',
},
content: {
readMore: 'Read More',
showLess: 'Show Less',
expand: 'Expand',
collapse: 'Collapse',
},
// ... additional text categories
}
}
| Category | Description | Covers |
|---|
navigation | Navigation control labels | First, last, next, previous, play/stop buttons |
search | Search functionality text | Search input, results, navigation |
theme | Theme switching labels | Dark/light mode toggles |
layout | Layout mode labels | Vertical, horizontal, alternating modes |
fullscreen | Fullscreen functionality | Enter/exit fullscreen, error messages |
quickJump | Quick navigation | Jump to item dropdown |
content | Content interaction | Read more, expand/collapse |
status | Loading and error states | Loading, error, empty states |
accessibility | Screen reader labels | ARIA labels and descriptions |
view | View options | Compact/detailed view toggles |
keyboard | Keyboard help | Keyboard navigation instructions |
Some text properties support template variables using {variable} syntax:
search: {
resultsCount: '{current} of {total}', // "1 of 5"
},
accessibility: {
itemPosition: 'Item {current} of {total}', // "Item 3 of 10"
},
quickJump: {
itemTemplate: '{index}: {title}', // "1: My Title"
}
// English (default)
const englishTexts = {
navigation: {
first: 'Go to first item',
last: 'Go to last item',
next: 'Next item',
previous: 'Previous item',
},
search: {
placeholder: 'Search Timeline',
clearLabel: 'Clear Search',
}
};
// Spanish
const spanishTexts = {
navigation: {
first: 'Ir al primer elemento',
last: 'Ir al รบltimo elemento',
next: 'Siguiente elemento',
previous: 'Elemento anterior',
},
search: {
placeholder: 'Buscar en la Lรญnea de Tiempo',
clearLabel: 'Limpiar Bรบsqueda',
}
};
<Chrono
items={items}
i18n={{ texts: spanishTexts, locale: 'es' }}
/>
The new i18n system is fully compatible with existing accessibility.buttonTexts configuration. When both are provided, i18n texts take precedence for supported properties.
// Legacy (still works)
<Chrono
accessibility={{
buttonTexts: {
first: 'First',
next: 'Next',
}
}}
/>
// New i18n (recommended)
<Chrono
i18n={{
texts: {
navigation: {
first: 'First',
next: 'Next',
}
}
}}
/>
Comprehensive theming system with 36 customizable properties.
interface Theme {
// Base Colors
primary?: string;
secondary?: string;
textColor?: string;
// Card Colors
cardBgColor?: string;
cardDetailsBackGround?: string;
cardDetailsColor?: string;
cardMediaBgColor?: string;
cardSubtitleColor?: string;
cardTitleColor?: string;
detailsColor?: string;
// Timeline Colors
titleColor?: string;
titleColorActive?: string;
timelineBgColor?: string;
iconBackgroundColor?: string;
// Toolbar Colors
toolbarBgColor?: string;
toolbarBtnBgColor?: string;
toolbarTextColor?: string;
// Nested Timeline Colors
nestedCardBgColor?: string;
nestedCardDetailsBackGround?: string;
nestedCardDetailsColor?: string;
nestedCardSubtitleColor?: string;
nestedCardTitleColor?: string;
// Enhanced Dark Mode Properties
iconColor?: string;
buttonHoverBgColor?: string;
buttonActiveBgColor?: string;
buttonActiveIconColor?: string;
buttonBorderColor?: string;
buttonHoverBorderColor?: string;
buttonActiveBorderColor?: string;
shadowColor?: string;
glowColor?: string;
searchHighlightColor?: string;
// Dark Toggle Specific
darkToggleActiveBgColor?: string;
darkToggleActiveIconColor?: string;
darkToggleActiveBorderColor?: string;
darkToggleGlowColor?: string;
}
| Property | Type | Description | Example |
|---|
primary | string | Primary accent color | '#0079e6' |
secondary | string | Secondary accent color | '#666666' |
textColor | string | Default text color | '#333333' |
| Property | Type | Description |
|---|
cardBgColor | string | Background color for timeline cards |
cardDetailsBackGround | string | Background color for card details section |
cardDetailsColor | string | Text color for card details |
cardMediaBgColor | string | Background color for media section |
cardSubtitleColor | string | Color for card subtitles |
cardTitleColor | string | Color for card titles |
detailsColor | string | Color for detailed content text |
| Property | Type | Description |
|---|
titleColor | string | Color for timeline item titles |
titleColorActive | string | Color for active timeline titles |
timelineBgColor | string | Background color for the timeline |
iconBackgroundColor | string | Background color for timeline icons |
| Property | Type | Description |
|---|
toolbarBgColor | string | Background color for the toolbar |
toolbarBtnBgColor | string | Background color for toolbar buttons |
toolbarTextColor | string | Text color for toolbar elements |
| Property | Type | Description |
|---|
iconColor | string | Color for icons in dark mode |
buttonHoverBgColor | string | Button background on hover |
buttonActiveBgColor | string | Button background when active |
buttonActiveIconColor | string | Icon color for active buttons |
buttonBorderColor | string | Border color for buttons |
buttonHoverBorderColor | string | Border color for buttons on hover |
buttonActiveBorderColor | string | Border color for active buttons |
shadowColor | string | Color for shadows and depth effects |
glowColor | string | Color for glow effects and focus states |
searchHighlightColor | string | Color for search result highlighting |
| Property | Type | Description |
|---|
darkToggleActiveBgColor | string | Background when dark mode toggle is active |
darkToggleActiveIconColor | string | Icon color when dark mode toggle is active |
darkToggleActiveBorderColor | string | Border color when dark mode toggle is active |
darkToggleGlowColor | string | Glow effect color for dark mode toggle |
Complete structure for timeline items with support for rich content and nested timelines.
interface TimelineItem {
// Core Properties
title?: string | ReactNode;
cardTitle?: string | ReactNode;
cardSubtitle?: string | ReactNode;
cardDetailedText?: string | string[] | ReactNode | ReactNode[];
// Media Content
media?: Media;
// Navigation & Links
url?: string;
date?: Date | string | number;
// Custom Content
timelineContent?: ReactNode;
content?: ReactNode | ReactNode[];
// Nested Timelines
items?: TimelineItem[];
hasNestedItems?: boolean;
isNested?: boolean;
// State & Control
active?: boolean;
visible?: boolean;
id?: string;
position?: string;
// Internal Properties
_dayjs?: Dayjs;
}
| Property | Type | Required | Description |
|---|
title | string | ReactNode | โ | Title displayed on timeline point |
cardTitle | string | ReactNode | โ | Main title displayed on card |
cardSubtitle | string | ReactNode | โ | Subtitle displayed on card |
cardDetailedText | string | string[] | ReactNode | ReactNode[] | โ | Main content of the card |
media | Media | โ | Image or video content |
url | string | โ | URL for the title link |
date | Date | string | number | โ | Date for the timeline item |
timelineContent | ReactNode | โ | Custom React content for the card |
content | ReactNode | ReactNode[] | โ | Alternative custom content |
items | TimelineItem[] | โ | Nested timeline items |
active | boolean | โ | Whether item is initially active |
visible | boolean | โ | Whether item is visible |
id | string | โ | Unique identifier |
interface Media {
type: 'IMAGE' | 'VIDEO';
source: {
url: string;
type?: string; // MIME type or file extension
};
name?: string; // Alt text / description
}
| Property | Type | Required | Description |
|---|
type | 'IMAGE' | 'VIDEO' | โ
| Type of media content |
source.url | string | โ
| URL of the media file |
source.type | string | โ | MIME type or file extension |
name | string | โ | Alt text for images or description |
Image Example:
{
title: "Historic Moment",
cardTitle: "The Discovery",
media: {
type: "IMAGE",
source: { url: "https://example.com/image.jpg" },
name: "Archaeological site discovery"
}
}
Video Example:
{
title: "Launch Event",
cardTitle: "Mission Success",
media: {
type: "VIDEO",
source: {
url: "https://example.com/video.mp4",
type: "mp4"
},
name: "Rocket launch footage",
active: true // Auto-play when active
}
}
YouTube Video Example:
{
title: "Tutorial",
cardTitle: "How to Use",
media: {
type: "VIDEO",
source: {
url: "https://www.youtube.com/embed/VIDEO_ID",
type: "youtube"
},
name: "Tutorial video"
}
}
Handle user interactions and timeline state changes.
| Callback | Type | Description |
|---|
onItemSelected | ItemSelectedCallback | Fired when a timeline item is selected |
onScrollEnd | () => void | Fired when scrolling reaches the end |
onThemeChange | (theme: Theme) => void | Fired when theme changes |
onRestartSlideshow | () => void | Fired when slideshow restarts |
type ItemSelectedCallback = (data: {
item: Pick<TimelineItem, 'title' | 'cardDetailedText' | 'cardSubtitle' | 'cardTitle'>;
index: number;
}) => void;
const handleItemSelected = ({ item, index }) => {
console.log('Selected item:', item.cardTitle);
console.log('Item index:', index);
};
const handleThemeChange = (newTheme) => {
console.log('Theme changed:', newTheme);
// Save theme preference
localStorage.setItem('theme', JSON.stringify(newTheme));
};
<Chrono
items={items}
onItemSelected={handleItemSelected}
onThemeChange={handleThemeChange}
onScrollEnd={() => console.log('Reached end of timeline')}
/>
These props are maintained for backward compatibility but are deprecated in favor of the grouped configuration API.
| Legacy Prop | New API | Type | Description |
|---|
cardWidth | layout.cardWidth | number | โ ๏ธ Deprecated |
cardHeight | layout.cardHeight | number | 'auto' | โ ๏ธ Deprecated |
timelinePointDimension | layout.pointSize | number | โ ๏ธ Deprecated |
lineWidth | layout.lineWidth | number | โ ๏ธ Deprecated |
itemWidth | layout.itemWidth | number | โ ๏ธ Deprecated |
responsiveBreakPoint | layout.responsive.breakpoint | number | โ ๏ธ Deprecated |
enableBreakPoint | layout.responsive.enabled | boolean | โ ๏ธ Deprecated |
cardPositionHorizontal | layout.positioning.cardPosition | 'TOP' | 'BOTTOM' | โ ๏ธ Deprecated |
flipLayout | layout.positioning.flipLayout | boolean | โ ๏ธ Deprecated |
| Legacy Prop | New API | Type | Description |
|---|
disableNavOnKey | interaction.keyboardNavigation | boolean | โ ๏ธ Deprecated (inverted) |
disableClickOnCircle | interaction.pointClick | boolean | โ ๏ธ Deprecated (inverted) |
disableAutoScrollOnClick | interaction.autoScroll | boolean | โ ๏ธ Deprecated (inverted) |
focusActiveItemOnLoad | interaction.focusOnLoad | boolean | โ ๏ธ Deprecated |
highlightCardsOnHover | interaction.cardHover | boolean | โ ๏ธ Deprecated |
disableInteraction | interaction.disabled | boolean | โ ๏ธ Deprecated |
| Legacy Prop | New API | Type | Description |
|---|
parseDetailsAsHTML | content.allowHTML | boolean | โ ๏ธ Deprecated |
useReadMore | content.readMore | boolean | โ ๏ธ Deprecated |
textOverlay | content.textOverlay | boolean | โ ๏ธ Deprecated |
titleDateFormat | content.dateFormat | string | โ ๏ธ Deprecated |
textDensity | content.compactText | 'LOW' | 'HIGH' | โ ๏ธ Deprecated |
semanticTags | content.semanticTags | SemanticTags | โ ๏ธ Deprecated |
| Legacy Prop | New API | Type | Description |
|---|
borderLessCards | display.borderless | boolean | โ ๏ธ Deprecated |
cardLess | display.cardsDisabled | boolean | โ ๏ธ Deprecated |
disableTimelinePoint | display.pointsDisabled | boolean | โ ๏ธ Deprecated |
timelinePointShape | display.pointShape | 'circle' | 'square' | 'diamond' | โ ๏ธ Deprecated |
showAllCardsHorizontal | display.allCardsVisible | boolean | โ ๏ธ Deprecated |
disableToolbar | display.toolbar.enabled | boolean | โ ๏ธ Deprecated (inverted) |
toolbarPosition | display.toolbar.position | 'top' | 'bottom' | โ ๏ธ Deprecated |
scrollable | display.scrollable | boolean | {scrollbar: boolean} | โ ๏ธ Deprecated |
| Legacy Prop | New API | Type | Description |
|---|
mediaHeight | media.height | number | โ ๏ธ Deprecated |
mediaSettings | media | MediaSettings | โ ๏ธ Deprecated |
| Legacy Prop | New API | Type | Description |
|---|
slideShow | animation.slideshow.enabled | boolean | โ ๏ธ Deprecated |
slideItemDuration | animation.slideshow.duration | number | โ ๏ธ Deprecated |
slideShowType | animation.slideshow.type | SlideShowType | โ ๏ธ Deprecated |
showProgressOnSlideshow | animation.slideshow.showProgress | boolean | โ ๏ธ Deprecated |
showOverallSlideshowProgress | animation.slideshow.showOverallProgress | boolean | โ ๏ธ Deprecated |
| Legacy Prop | New API | Type | Description |
|---|
classNames | style.classNames | ClassNames | โ ๏ธ Deprecated |
fontSizes | style.fontSizes | FontSizes | โ ๏ธ Deprecated |
| Legacy Prop | New API | Type | Description |
|---|
buttonTexts | accessibility.buttonTexts | ButtonTexts | โ ๏ธ Deprecated |
Complete TypeScript definitions for all interfaces and types.
// Timeline modes
type TimelineMode = 'horizontal' | 'vertical' | 'alternating' | 'horizontal-all';
// Legacy mode mapping
type LegacyTimelineMode = 'VERTICAL' | 'HORIZONTAL' | 'VERTICAL_ALTERNATING' | 'HORIZONTAL_ALL';
// Media types
type MediaType = 'VIDEO' | 'IMAGE';
// Text density (legacy)
type TextDensity = 'LOW' | 'HIGH';
// Slideshow animation types
type SlideShowType = 'reveal' | 'slide_in' | 'slide_from_sides';
// New slideshow animation types
type SlideshowAnimationType = 'reveal' | 'slide' | 'fade';
// Media fit options
type MediaFit = 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
// Font weights
type FontWeight =
| 'thin' | 'extra-light' | 'light' | 'regular' | 'medium'
| 'semi-bold' | 'bold' | 'extra-bold' | 'black'
| 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
// Font display strategies
type FontDisplay = 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
// HTML tag options for semantic tags
type HTMLTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'div';
interface LayoutConfig {
cardWidth?: number;
cardHeight?: number | 'auto';
pointSize?: number;
lineWidth?: number;
itemWidth?: number;
timelineHeight?: number | string;
responsive?: {
breakpoint?: number;
enabled?: boolean;
};
positioning?: {
cardPosition?: 'top' | 'bottom';
flipLayout?: boolean;
};
}
interface InteractionConfig {
keyboardNavigation?: boolean;
pointClick?: boolean;
autoScroll?: boolean;
focusOnLoad?: boolean;
cardHover?: boolean;
disabled?: boolean;
}
interface ContentConfig {
allowHTML?: boolean;
readMore?: boolean;
textOverlay?: boolean;
dateFormat?: string;
compactText?: boolean;
semanticTags?: {
title?: HTMLTag;
subtitle?: HTMLTag;
};
alignment?: {
horizontal?: 'left' | 'center' | 'right' | 'stretch';
vertical?: 'top' | 'center' | 'bottom' | 'stretch';
};
}
interface DisplayConfig {
borderless?: boolean;
cardsDisabled?: boolean;
pointsDisabled?: boolean;
pointShape?: 'circle' | 'square' | 'diamond';
allCardsVisible?: boolean;
toolbar?: {
enabled?: boolean;
position?: 'top' | 'bottom';
sticky?: boolean;
};
scrollable?: boolean | {
scrollbar: boolean;
};
}
interface MediaConfig {
height?: number;
align?: 'left' | 'center' | 'right';
fit?: MediaFit;
}
interface AnimationConfig {
slideshow?: {
enabled?: boolean;
duration?: number;
type?: SlideshowAnimationType;
autoStart?: boolean;
showProgress?: boolean;
showOverallProgress?: boolean;
};
}
interface StyleConfig {
classNames?: {
card?: string;
cardMedia?: string;
cardSubTitle?: string;
cardText?: string;
cardTitle?: string;
controls?: string;
title?: string;
timelinePoint?: string;
timelineTrack?: string;
};
fontSizes?: {
cardSubtitle?: string;
cardText?: string;
cardTitle?: string;
title?: string;
};
googleFonts?: GoogleFontsConfig;
}
interface AccessibilityConfig {
buttonTexts?: {
first?: string;
last?: string;
next?: string;
previous?: string;
play?: string;
stop?: string;
};
search?: {
placeholder?: string;
ariaLabel?: string;
clearLabel?: string;
};
}
interface GoogleFontsConfig {
fontFamily: string;
elements?: {
title?: FontElement;
cardTitle?: FontElement;
cardSubtitle?: FontElement;
cardText?: FontElement;
controls?: FontElement;
};
weights?: FontWeight[];
display?: FontDisplay;
preconnect?: boolean;
}
interface FontElement {
weight?: FontWeight;
style?: 'normal' | 'italic';
size?: string;
}
interface I18nConfig {
/** Complete internationalization configuration for all timeline texts */
texts?: TimelineI18nConfig;
/** Locale code (e.g., 'en', 'es', 'fr', 'de') for future locale-specific features */
locale?: string;
/** Text direction for RTL language support */
direction?: 'ltr' | 'rtl';
}
// Complete text configuration interface with all categories
interface TimelineI18nConfig {
navigation?: NavigationTexts;
search?: SearchTexts;
theme?: ThemeTexts;
layout?: LayoutTexts;
fullscreen?: FullscreenTexts;
quickJump?: QuickJumpTexts;
content?: ContentTexts;
status?: StatusTexts;
accessibility?: AccessibilityTexts;
view?: ViewTexts;
keyboard?: KeyboardTexts;
}
interface DarkModeConfig {
/** Enable dark mode */
enabled?: boolean;
/** Show dark mode toggle button in toolbar */
showToggle?: boolean;
}
// New grouped API (Recommended)
interface TimelinePropsV2 {
// Core props
items: TimelineItem[];
mode?: TimelineMode;
children?: ReactNode | ReactNode[];
theme?: Theme;
activeItemIndex?: number;
allowDynamicUpdate?: boolean;
id?: string;
// Grouped configurations
layout?: LayoutConfig;
interaction?: InteractionConfig;
content?: ContentConfig;
display?: DisplayConfig;
media?: MediaConfig;
animation?: AnimationConfig;
style?: StyleConfig;
accessibility?: AccessibilityConfig;
// Dark mode
darkMode?: DarkModeConfig;
// Event callbacks
onItemSelected?: (data: { item: TimelineItem; index: number }) => void;
onScrollEnd?: () => void;
onThemeChange?: (theme: Theme) => void;
onRestartSlideshow?: () => void;
}
// Legacy props interface (for backward compatibility)
interface LegacyTimelineProps {
// All deprecated props listed in the legacy section above
// ... (see Legacy Props section for complete list)
}
// Combined interface
type TimelineProps = TimelinePropsV2 & LegacyTimelineProps;
import { Chrono } from 'react-chrono';
const App = () => {
const items = [
{
title: "2024-01-01",
cardTitle: "New Year Launch",
cardSubtitle: "Project Kickoff",
cardDetailedText: "Started our new ambitious project with great enthusiasm.",
media: {
type: "IMAGE",
source: { url: "/images/launch.jpg" },
name: "Project launch ceremony"
}
},
// ... more items
];
return (
<div style={{ width: '100vw', height: '100vh' }}>
<Chrono
items={items}
mode="alternating"
layout={{
cardWidth: 450,
cardHeight: 'auto', // Automatic sizing based on content
pointSize: 18,
responsive: {
enabled: true,
breakpoint: 768,
},
}}
interaction={{
keyboardNavigation: true,
pointClick: true,
autoScroll: true,
focusOnLoad: true,
}}
content={{
allowHTML: false,
readMore: true,
dateFormat: 'MMM YYYY',
semanticTags: {
title: 'h2',
subtitle: 'h3',
},
alignment: {
horizontal: 'center',
vertical: 'center',
},
}}
display={{
borderless: false,
pointShape: 'circle',
toolbar: {
enabled: true,
position: 'top',
sticky: true,
},
}}
media={{
height: 200,
align: 'center',
fit: 'cover',
}}
animation={{
slideshow: {
enabled: true,
duration: 3000,
type: 'fade',
showProgress: true,
},
}}
style={{
googleFonts: {
fontFamily: 'Inter',
elements: {
cardTitle: { weight: 'bold', size: '1.2rem' },
cardSubtitle: { weight: 'medium', size: '0.9rem' },
},
preconnect: true,
},
}}
accessibility={{
buttonTexts: {
play: 'Start Timeline',
stop: 'Pause Timeline',
},
}}
theme={{
primary: '#0079e6',
cardBgColor: '#ffffff',
cardTitleColor: '#1f2937',
}}
darkMode={{
enabled: false,
showToggle: true,
}}
onItemSelected={({ item, index }) => {
console.log(`Selected: ${item.cardTitle} at index ${index}`);
}}
onThemeChange={(theme) => {
console.log('Theme updated:', theme);
}}
/>
</div>
);
};
๐ For more examples and interactive demos, visit our Storybook
๐ Found an issue or missing property? Report it on GitHub
This documentation covers React Chrono v3.0 and later