react-chrono-extra
Version:
A Modern Timeline component for React
34 lines (33 loc) • 1.35 kB
TypeScript
/// <reference types="@types/react" />
import { Theme } from '@models/Theme';
import { TimelineMode } from '@models/TimelineModel';
import React from 'react';
export declare enum OutlinePosition {
'left' = 0,
'right' = 1
}
export interface TimelineOutlineModel {
items?: TimelineOutlineItem[];
mode?: TimelineMode;
onSelect?: (index: number) => void;
theme?: Theme;
}
export interface TimelineOutlineItem {
id?: string;
name?: string;
selected?: boolean;
}
/**
* TimelineOutline component
* This component renders the outline pane of a timeline, including a list of items and corresponding selection functionality.
* It provides an interface to toggle the outline pane and select items within the timeline.
* The component leverages memoization to prevent unnecessary re-renders and optimizes the rendering process.
*
* @property {TimelineOutlineItem[]} items - The items to be displayed in the outline.
* @property {TimelineMode} mode - The mode of the timeline which determines the outline position.
* @property {function} onSelect - The callback to be invoked when an item is selected.
* @property {Theme} theme - The theme object, used for styling.
* @returns {JSX.Element} The TimelineOutline component.
*/
declare const TimelineOutline: React.FC<TimelineOutlineModel>;
export { TimelineOutline };