React Chrono - Complete Props Reference

December 12, 2025 ยท View on GitHub

๐Ÿ“‹ 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
activeItemIndexnumber0โŒIndex of initially active timeline item
allowDynamicUpdatebooleanfalseโŒEnable 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

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

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

Layout Properties Table

PropertyTypeDefaultDescription
cardWidthnumber450Maximum width of timeline cards in pixels
cardHeightnumber | 'auto'200Height of timeline cards in pixels, or 'auto' for automatic sizing based on content
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

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

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

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

Content Alignment Configuration

Control how text content is aligned within timeline cards.

PropertyTypeDefaultDescription
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
    }
  }}
/>

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

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

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

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

๐ŸŽฌ Animation Configuration

Control slideshow functionality and transition effects.

Animation Config Object

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

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

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

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

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

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

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

Comprehensive Text Configuration

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

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:

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

// 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.

// 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 36 customizable properties.

Theme Interface

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'#0079e6'
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

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 | ReactNodeโŒTitle displayed on timeline point
cardTitlestring | ReactNodeโŒMain title displayed on card
cardSubtitlestring | ReactNodeโŒSubtitle displayed on card
cardDetailedTextstring | string[] | ReactNode | ReactNode[]โŒMain content of the card
mediaMediaโŒImage or video content
urlstringโŒURL for the title link
dateDate | string | numberโŒDate for the timeline item
timelineContentReactNodeโŒCustom React content for the card
contentReactNode | ReactNode[]โŒAlternative custom content
itemsTimelineItem[]โŒNested timeline items
activebooleanโŒWhether item is initially active
visiblebooleanโŒWhether item is visible
idstringโŒUnique identifier

Media Interface

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.urlstringโœ…URL of the media file
source.typestringโŒMIME type or file extension
namestringโŒAlt text for images or description

Media Examples

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

๐Ÿ“ฑ 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

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

Example Usage

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 | 'auto'โš ๏ธ 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

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

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

Google Fonts Configuration

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

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

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

Complete Props Interface

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

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