Skip to content

React Chrono - Complete Props Reference

📋 Comprehensive documentation of all supported properties

This document covers every prop, configuration option, and interface in React Chrono


📑 Table of Contents


🎯 Core Props

These are the essential properties that define the basic behavior of your timeline.

PropertyTypeDefaultRequiredDescription
itemsTimelineItem[][]Array of timeline items to display
modeTimelineMode'alternating'Timeline display mode
childrenReactNode | ReactNode[]-Custom React content for timeline cards
themeTheme{}Visual theme configuration
activeItemIndexnumber0Index of initially active timeline item
allowDynamicUpdatebooleanfalseEnable dynamic updates to timeline items
idstring-Custom unique identifier for the timeline
i18nI18nConfig-Internationalization configuration for multi-language support
darkModeDarkModeConfig-Dark mode configuration and toggle options

Timeline Mode Values

typescript
type TimelineMode = 
  | 'horizontal'      // Classic left-to-right layout
  | 'vertical'        // Top-to-bottom layout  
  | 'alternating'     // Cards alternate sides (default)
  | 'horizontal-all'  // Show all cards simultaneously

📐 Layout Configuration

Control the size, positioning, and responsive behavior of your timeline.

Layout Config Object

typescript
layout?: {
  cardWidth?: number;
  cardHeight?: number;
  pointSize?: number;
  lineWidth?: number;
  itemWidth?: number;
  timelineHeight?: number | string;
  responsive?: {
    breakpoint?: number;
    enabled?: boolean;
  };
  positioning?: {
    cardPosition?: 'top' | 'bottom';
    flipLayout?: boolean;
  };
}

Layout Properties Table

PropertyTypeDefaultDescription
cardWidthnumber450Maximum width of timeline cards in pixels
cardHeightnumber200Minimum height of timeline cards in pixels
pointSizenumber16Size of timeline points/circles in pixels
lineWidthnumber3Width of the timeline track line in pixels
itemWidthnumber200Width of each timeline section in horizontal mode (px)
timelineHeightnumber | string-Fixed height for the timeline container

Responsive Configuration

PropertyTypeDefaultDescription
responsive.breakpointnumber768Viewport width breakpoint for mode switching (px)
responsive.enabledbooleantrueEnable automatic responsive mode switching

Positioning Configuration

PropertyTypeDefaultDescription
positioning.cardPosition'top' | 'bottom'-Card position in horizontal mode
positioning.flipLayoutbooleanfalseFlip layout direction for RTL support

🎮 Interaction Configuration

Configure user interactions and navigation behavior.

Interaction Config Object

typescript
interaction?: {
  keyboardNavigation?: boolean;
  pointClick?: boolean;
  autoScroll?: boolean;
  focusOnLoad?: boolean;
  cardHover?: boolean;
  disabled?: boolean;
}

Interaction Properties Table

PropertyTypeDefaultDescription
keyboardNavigationbooleantrueEnable arrow key navigation
pointClickbooleantrueEnable clicking on timeline points
autoScrollbooleantrueAuto-scroll to active items when selected
focusOnLoadbooleanfalseFocus active item when timeline loads
cardHoverbooleanfalseHighlight cards on mouse hover
disabledbooleanfalseDisable all user interactions

Keyboard Navigation Keys

KeysModeAction
HorizontalNavigate between items
Vertical/AlternatingNavigate between items
HomeAllJump to first item
EndAllJump to last item
EnterAllSelect focused item
EscapeAllExit fullscreen/pause slideshow

📝 Content Configuration

Handle text content, HTML parsing, and semantic structure.

Content Config Object

typescript
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';
  };
}

Content Properties Table

PropertyTypeDefaultDescription
allowHTMLbooleanfalseAllow HTML parsing in card content
readMorebooleantrueEnable "read more" button for long content
textOverlaybooleanfalseDisplay text as overlay on media
dateFormatstring'MMM DD, YYYY'Date format for timeline titles (Day.js format)
compactTextbooleanfalseUse compact text display mode

Semantic Tags Configuration

PropertyTypeDefaultDescription
semanticTags.titleHTMLTag'h3'HTML tag for timeline item titles
semanticTags.subtitleHTMLTag'h4'HTML tag for timeline card subtitles

Supported HTML Tags

'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'div'


🎨 Display Configuration

Control visual appearance, UI elements, and layout options.

Display Config Object

typescript
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;
  };
}

Display Properties Table

PropertyTypeDefaultDescription
borderlessbooleanfalseRemove borders and shadows from cards
cardsDisabledbooleanfalseHide timeline cards completely
pointsDisabledbooleanfalseHide timeline points
pointShape'circle' | 'square' | 'diamond''circle'Shape of timeline points
allCardsVisiblebooleanfalseShow all cards simultaneously in horizontal mode

Toolbar Configuration

PropertyTypeDefaultDescription
toolbar.enabledbooleantrueShow/hide the toolbar
toolbar.position'top' | 'bottom''top'Position of the toolbar
toolbar.stickybooleanfalseMake toolbar sticky during scroll
toolbar.search.widthstring-Default width of search section (CSS length)
toolbar.search.maxWidthstring-Maximum width of search section (CSS length)
toolbar.search.minWidthstring-Minimum width of search section (CSS length)
toolbar.search.inputWidthstring-Width of actual input field (CSS length)
toolbar.search.inputMaxWidthstring-Maximum width of actual input field (CSS length)

Scrollable Configuration

PropertyTypeDefaultDescription
scrollableboolean | {scrollbar: boolean}{scrollbar: false}Enable scrolling for vertical modes

🎥 Media Configuration

Configure images, videos, and media handling.

Media Config Object

typescript
media?: {
  height?: number;
  align?: 'left' | 'center' | 'right';
  fit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
}

Media Properties Table

PropertyTypeDefaultDescription
heightnumber200Minimum height of media elements in pixels
align'left' | 'center' | 'right''left'Media alignment within cards
fitMediaFit'cover'CSS object-fit property for images

Media Fit Values

typescript
type MediaFit = 'cover' | 'contain' | 'fill' | 'none' | 'scale-down'

🎬 Animation Configuration

Control slideshow functionality and transition effects.

Animation Config Object

typescript
animation?: {
  slideshow?: {
    enabled?: boolean;
    duration?: number;
    type?: 'reveal' | 'slide' | 'fade';
    autoStart?: boolean;
    showProgress?: boolean;
    showOverallProgress?: boolean;
  };
}

Slideshow Properties Table

PropertyTypeDefaultDescription
slideshow.enabledbooleanfalseEnable slideshow functionality
slideshow.durationnumber2000Duration each slide is displayed (milliseconds)
slideshow.typeSlideshowType'fade'Type of transition animation
slideshow.autoStartbooleanfalseAuto-start slideshow on load
slideshow.showProgressbooleanfalseShow progress indicator on cards
slideshow.showOverallProgressbooleantrueShow overall progress bar

Slideshow Animation Types

typescript
type SlideshowType = 
  | 'reveal'        // Cards reveal progressively
  | 'slide'         // Cards slide in from sides
  | 'fade'          // Cards fade in/out

✨ Style Configuration

Customize CSS classes, fonts, and Google Fonts integration.

Style Config Object

typescript
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;
}

CSS Class Names

PropertyDescriptionTarget Element
classNames.cardTimeline card containerCard wrapper
classNames.cardMediaMedia within cardsImages/videos
classNames.cardSubTitleCard subtitle textSubtitle element
classNames.cardTextCard body textMain content
classNames.cardTitleCard title textTitle element
classNames.controlsToolbar controlsControl buttons
classNames.titleTimeline item titlesPoint labels
classNames.timelinePointTimeline pointsCircle/square points
classNames.timelineTrackTimeline lineMain timeline line

Font Size Configuration

PropertyTypeDefaultDescription
fontSizes.titlestring-Font size for timeline item titles
fontSizes.cardTitlestring-Font size for card titles
fontSizes.cardSubtitlestring-Font size for card subtitles
fontSizes.cardTextstring-Font size for card body text

Google Fonts Configuration

typescript
googleFonts?: {
  fontFamily: string;
  elements?: {
    title?: FontElement;
    cardTitle?: FontElement;
    cardSubtitle?: FontElement;
    cardText?: FontElement;
    controls?: FontElement;
  };
  weights?: FontWeight[];
  display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
  preconnect?: boolean;
}

Font Element Configuration

typescript
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

Google Fonts Properties Table

PropertyTypeDefaultDescription
fontFamilystring-Google Fonts family name
elementsFontElements-Font configuration for different elements
weightsFontWeight[]-Additional font weights to load
displayFontDisplay'swap'Font display strategy
preconnectbooleantruePreconnect to Google Fonts for faster loading

♿ Accessibility Configuration

Customize labels, ARIA attributes, and screen reader support.

Accessibility Config Object

typescript
accessibility?: {
  buttonTexts?: {
    first?: string;
    last?: string;
    next?: string;
    previous?: string;
    play?: string;
    stop?: string;
  };
  search?: {
    placeholder?: string;
    ariaLabel?: string;
    clearLabel?: string;
  };
}

Button Text Labels

PropertyTypeDefaultDescription
buttonTexts.firststring'Go to first item'First button label
buttonTexts.laststring'Go to last item'Last button label
buttonTexts.nextstring'Next item'Next button label
buttonTexts.previousstring'Previous item'Previous button label
buttonTexts.playstring'Start slideshow'Play button label
buttonTexts.stopstring'Stop slideshow'Stop button label

Search Configuration

PropertyTypeDefaultDescription
search.placeholderstring'Search...'Search input placeholder
search.ariaLabelstring'Search timeline'ARIA label for search input
search.clearLabelstring'Clear search'Clear search button label

🌍 Internationalization Configuration

Complete internationalization support for all user-facing text in the timeline component.

i18n Config Object

typescript
i18n?: {
  texts?: TimelineI18nConfig;
  locale?: string;
  direction?: 'ltr' | 'rtl';
}

Comprehensive Text Configuration

The texts configuration provides internationalization support for all timeline text elements:

typescript
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
  }
}

Text Categories

CategoryDescriptionCovers
navigationNavigation control labelsFirst, last, next, previous, play/stop buttons
searchSearch functionality textSearch input, results, navigation
themeTheme switching labelsDark/light mode toggles
layoutLayout mode labelsVertical, horizontal, alternating modes
fullscreenFullscreen functionalityEnter/exit fullscreen, error messages
quickJumpQuick navigationJump to item dropdown
contentContent interactionRead more, expand/collapse
statusLoading and error statesLoading, error, empty states
accessibilityScreen reader labelsARIA labels and descriptions
viewView optionsCompact/detailed view toggles
keyboardKeyboard helpKeyboard navigation instructions

Template String Support

Some text properties support template variables using {variable} syntax:

typescript
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"
}

Multi-language Example

typescript
// 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' }}
/>

Legacy Compatibility

The new i18n system is fully compatible with existing accessibility.buttonTexts configuration. When both are provided, i18n texts take precedence for supported properties.

typescript
// Legacy (still works)
<Chrono
  accessibility={{
    buttonTexts: {
      first: 'First',
      next: 'Next',
    }
  }}
/>

// New i18n (recommended)
<Chrono
  i18n={{
    texts: {
      navigation: {
        first: 'First',
        next: 'Next',
      }
    }
  }}
/>

🎨 Theme Properties

Comprehensive theming system with 25+ customizable properties.

Theme Interface

typescript
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;
}

Theme Properties by Category

Base Theme Colors

PropertyTypeDescriptionExample
primarystringPrimary accent color'#0070f3'
secondarystringSecondary accent color'#666666'
textColorstringDefault text color'#333333'

Card Theme Colors

PropertyTypeDescription
cardBgColorstringBackground color for timeline cards
cardDetailsBackGroundstringBackground color for card details section
cardDetailsColorstringText color for card details
cardMediaBgColorstringBackground color for media section
cardSubtitleColorstringColor for card subtitles
cardTitleColorstringColor for card titles
detailsColorstringColor for detailed content text

Timeline Theme Colors

PropertyTypeDescription
titleColorstringColor for timeline item titles
titleColorActivestringColor for active timeline titles
timelineBgColorstringBackground color for the timeline
iconBackgroundColorstringBackground color for timeline icons

Toolbar Theme Colors

PropertyTypeDescription
toolbarBgColorstringBackground color for the toolbar
toolbarBtnBgColorstringBackground color for toolbar buttons
toolbarTextColorstringText color for toolbar elements

Enhanced Dark Mode Colors

PropertyTypeDescription
iconColorstringColor for icons in dark mode
buttonHoverBgColorstringButton background on hover
buttonActiveBgColorstringButton background when active
buttonActiveIconColorstringIcon color for active buttons
buttonBorderColorstringBorder color for buttons
buttonHoverBorderColorstringBorder color for buttons on hover
buttonActiveBorderColorstringBorder color for active buttons
shadowColorstringColor for shadows and depth effects
glowColorstringColor for glow effects and focus states
searchHighlightColorstringColor for search result highlighting

Dark Mode Toggle Colors

PropertyTypeDescription
darkToggleActiveBgColorstringBackground when dark mode toggle is active
darkToggleActiveIconColorstringIcon color when dark mode toggle is active
darkToggleActiveBorderColorstringBorder color when dark mode toggle is active
darkToggleGlowColorstringGlow effect color for dark mode toggle

📊 Timeline Item Model

Complete structure for timeline items with support for rich content and nested timelines.

TimelineItem Interface

typescript
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;
}

Timeline Item Properties

PropertyTypeRequiredDescription
titlestring | ReactNodeTitle displayed on timeline point
cardTitlestring | ReactNodeMain title displayed on card
cardSubtitlestring | ReactNodeSubtitle displayed on card
cardDetailedTextstring | string[] | ReactNode | ReactNode[]Main content of the card
mediaMediaImage or video content
urlstringURL for the title link
dateDate | string | numberDate for the timeline item
timelineContentReactNodeCustom React content for the card
contentReactNode | ReactNode[]Alternative custom content
itemsTimelineItem[]Nested timeline items
activebooleanWhether item is initially active
visiblebooleanWhether item is visible
idstringUnique identifier

Media Interface

typescript
interface Media {
  type: 'IMAGE' | 'VIDEO';
  source: {
    url: string;
    type?: string;  // MIME type or file extension
  };
  name?: string;    // Alt text / description
}

Media Properties

PropertyTypeRequiredDescription
type'IMAGE' | 'VIDEO'Type of media content
source.urlstringURL of the media file
source.typestringMIME type or file extension
namestringAlt text for images or description

Media Examples

Image Example:

javascript
{
  title: "Historic Moment",
  cardTitle: "The Discovery",
  media: {
    type: "IMAGE",
    source: { url: "https://example.com/image.jpg" },
    name: "Archaeological site discovery"
  }
}

Video Example:

javascript
{
  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:

javascript
{
  title: "Tutorial",
  cardTitle: "How to Use",
  media: {
    type: "VIDEO",
    source: { 
      url: "https://www.youtube.com/embed/VIDEO_ID",
      type: "youtube"
    },
    name: "Tutorial video"
  }
}

📱 Event Callbacks

Handle user interactions and timeline state changes.

Callback Functions

CallbackTypeDescription
onItemSelectedItemSelectedCallbackFired when a timeline item is selected
onScrollEnd() => voidFired when scrolling reaches the end
onThemeChange(theme: Theme) => voidFired when theme changes
onRestartSlideshow() => voidFired when slideshow restarts

ItemSelected Callback

typescript
type ItemSelectedCallback = (data: {
  item: Pick<TimelineItem, 'title' | 'cardDetailedText' | 'cardSubtitle' | 'cardTitle'>;
  index: number;
}) => void;

Example Usage

jsx
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')}
/>

🔄 Legacy Props (Deprecated)

These props are maintained for backward compatibility but are deprecated in favor of the grouped configuration API.

Layout Props (Use layout config instead)

Legacy PropNew APITypeDescription
cardWidthlayout.cardWidthnumber⚠️ Deprecated
cardHeightlayout.cardHeightnumber⚠️ Deprecated
timelinePointDimensionlayout.pointSizenumber⚠️ Deprecated
lineWidthlayout.lineWidthnumber⚠️ Deprecated
itemWidthlayout.itemWidthnumber⚠️ Deprecated
responsiveBreakPointlayout.responsive.breakpointnumber⚠️ Deprecated
enableBreakPointlayout.responsive.enabledboolean⚠️ Deprecated
cardPositionHorizontallayout.positioning.cardPosition'TOP' | 'BOTTOM'⚠️ Deprecated
flipLayoutlayout.positioning.flipLayoutboolean⚠️ Deprecated

Interaction Props (Use interaction config instead)

Legacy PropNew APITypeDescription
disableNavOnKeyinteraction.keyboardNavigationboolean⚠️ Deprecated (inverted)
disableClickOnCircleinteraction.pointClickboolean⚠️ Deprecated (inverted)
disableAutoScrollOnClickinteraction.autoScrollboolean⚠️ Deprecated (inverted)
focusActiveItemOnLoadinteraction.focusOnLoadboolean⚠️ Deprecated
highlightCardsOnHoverinteraction.cardHoverboolean⚠️ Deprecated
disableInteractioninteraction.disabledboolean⚠️ Deprecated

Content Props (Use content config instead)

Legacy PropNew APITypeDescription
parseDetailsAsHTMLcontent.allowHTMLboolean⚠️ Deprecated
useReadMorecontent.readMoreboolean⚠️ Deprecated
textOverlaycontent.textOverlayboolean⚠️ Deprecated
titleDateFormatcontent.dateFormatstring⚠️ Deprecated
textDensitycontent.compactText'LOW' | 'HIGH'⚠️ Deprecated
semanticTagscontent.semanticTagsSemanticTags⚠️ Deprecated

Display Props (Use display config instead)

Legacy PropNew APITypeDescription
borderLessCardsdisplay.borderlessboolean⚠️ Deprecated
cardLessdisplay.cardsDisabledboolean⚠️ Deprecated
disableTimelinePointdisplay.pointsDisabledboolean⚠️ Deprecated
timelinePointShapedisplay.pointShape'circle' | 'square' | 'diamond'⚠️ Deprecated
showAllCardsHorizontaldisplay.allCardsVisibleboolean⚠️ Deprecated
disableToolbardisplay.toolbar.enabledboolean⚠️ Deprecated (inverted)
toolbarPositiondisplay.toolbar.position'top' | 'bottom'⚠️ Deprecated
scrollabledisplay.scrollableboolean | {scrollbar: boolean}⚠️ Deprecated

Media Props (Use media config instead)

Legacy PropNew APITypeDescription
mediaHeightmedia.heightnumber⚠️ Deprecated
mediaSettingsmediaMediaSettings⚠️ Deprecated

Animation Props (Use animation config instead)

Legacy PropNew APITypeDescription
slideShowanimation.slideshow.enabledboolean⚠️ Deprecated
slideItemDurationanimation.slideshow.durationnumber⚠️ Deprecated
slideShowTypeanimation.slideshow.typeSlideShowType⚠️ Deprecated
showProgressOnSlideshowanimation.slideshow.showProgressboolean⚠️ Deprecated
showOverallSlideshowProgressanimation.slideshow.showOverallProgressboolean⚠️ Deprecated

Style Props (Use style config instead)

Legacy PropNew APITypeDescription
classNamesstyle.classNamesClassNames⚠️ Deprecated
fontSizesstyle.fontSizesFontSizes⚠️ Deprecated

Accessibility Props (Use accessibility config instead)

Legacy PropNew APITypeDescription
buttonTextsaccessibility.buttonTextsButtonTexts⚠️ Deprecated

🔍 Type Definitions

Complete TypeScript definitions for all interfaces and types.

Core Types

typescript
// 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';

Configuration Interfaces

typescript
interface LayoutConfig {
  cardWidth?: number;
  cardHeight?: number;
  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;
  };
}

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;
  };
}

Google Fonts Configuration

typescript
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;
}

Internationalization Configuration

typescript
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;
}

Dark Mode Configuration

typescript
interface DarkModeConfig {
  /** Enable dark mode */
  enabled?: boolean;
  /** Show dark mode toggle button in toolbar */
  showToggle?: boolean;
}

Complete Props Interface

typescript
// 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;

📝 Usage Examples

Complete Configuration Example

jsx
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: 250,
          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',
          },
        }}
        
        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: '#0070f3',
          cardBgColor: '#ffffff',
          cardTitleColor: '#1f2937',
          iconColor: '#0070f3',
          buttonActiveBgColor: '#0070f3',
        }}
        
        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 v2.9.1 and later

Released under the MIT License.