Timeline

Display list of events in chronological order
Import

Usage

New branch
You've created new branch fix-notifications from master
2 hours ago
Commits
You've pushed 23 commits to fix-notifications branch
52 minutes ago
Pull request
You've submitted a pull request Fix incorrect notification message (#187)
34 minutes ago
Code review
Robert Gluesticker left a code review on your pull request
12 minutes ago
import { Timeline, Text } from '@mantine/core';
import { GitBranch, GitPullRequest, GitCommit, MessageDots } from 'tabler-icons-react';
function Demo() {
return (
<Timeline active={1} bulletSize={24} lineWidth={2}>
<Timeline.Item bullet={<GitBranch size={12} />} title="New branch">
<Text color="dimmed" size="sm">You&apos;ve created new branch <Text variant="link" component="span" inherit>fix-notifications</Text> from master</Text>
<Text size="xs" mt={4}>2 hours ago</Text>
</Timeline.Item>
<Timeline.Item bullet={<GitCommit size={12} />} title="Commits">
<Text color="dimmed" size="sm">You&apos;ve pushed 23 commits to<Text variant="link" component="span" inherit>fix-notifications branch</Text></Text>
<Text size="xs" mt={4}>52 minutes ago</Text>
</Timeline.Item>
<Timeline.Item title="Pull request" bullet={<GitPullRequest size={12} />} lineVariant="dashed">
<Text color="dimmed" size="sm">You&apos;ve submitted a pull request<Text variant="link" component="span" inherit>Fix incorrect notification message (#187)</Text></Text>
<Text size="xs" mt={4}>34 minutes ago</Text>
</Timeline.Item>
<Timeline.Item title="Code review" bullet={<MessageDots size={12} />}>
<Text color="dimmed" size="sm"><Text variant="link" component="span" inherit>Robert Gluesticker</Text> left a code review on your pull request</Text>
<Text size="xs" mt={4}>12 minutes ago</Text>
</Timeline.Item>
</Timeline>
);
}

Line and bullet props

Control timeline appearance with the following props:

  • active – index of current active element, all elements before this index will be highlighted with color
  • color – color from theme that should be used to highlight active items, defaults to theme.primaryColor
  • lineWidth – controls line width and bullet border, value is in px
  • bulletSize – bullet width, height and border-radius in px
  • align – defines line and bullets position relative to content, also sets text-align
New branch
You've created new branch fix-notifications from master
2 hours ago
Commits
You've pushed 23 commits to fix-notifications branch
52 minutes ago
Pull request
You've submitted a pull request Fix incorrect notification message (#187)
34 minutes ago
Code review
Robert Gluesticker left a code review on your pull request
12 minutes ago
Color
Radius
xs
sm
md
lg
xl
Align
import { Timeline } from '@mantine/core';
function Demo() {
return (
<Timeline active={1}>
{/* items */}
</Timeline>
);
}

Bullet as React node

Default bullet
Default bullet without anything
Avatar
Timeline bullet as avatar image
Icon
Timeline bullet as icon
ThemeIcon
Timeline bullet as ThemeIcon component
import { ThemeIcon, Text, Avatar, Timeline } from '@mantine/core';
import { Sun, Video } from 'tabler-icons-react';
function Demo() {
return (
<div style={{ maxWidth: 320, margin: 'auto' }}>
<Timeline>
{/* If you do not pass bullet prop, default bullet will be rendered */}
<Timeline.Item title="Default bullet" bulletSize={24}>
<Text color="dimmed" size="sm">
Default bullet without anything
</Text>
</Timeline.Item>
{/* You can use any react node as bullet, e.g. Avatar, ThemeIcon or any svg icon */}
<Timeline.Item
title="Avatar"
bulletSize={24}
bullet={
<Avatar
size={22}
radius="xl"
src="https://avatars0.githubusercontent.com/u/10353856?s=460&u=88394dfd67727327c1f7670a1764dc38a8a24831&v=4"
/>
}
>
<Text color="dimmed" size="sm">
Timeline bullet as avatar image
</Text>
</Timeline.Item>
<Timeline.Item
title="Icon"
bulletSize={24}
bullet={<Sun size={14} />}
>
<Text color="dimmed" size="sm">
Timeline bullet as icon
</Text>
</Timeline.Item>
<Timeline.Item
title="ThemeIcon"
bulletSize={24}
bullet={
<ThemeIcon
size={22}
variant="gradient"
gradient={{ from: 'lime', to: 'cyan' }}
radius="xl"
>
<Video size={14} />
</ThemeIcon>
}
>
<Text color="dimmed" size="sm">
Timeline bullet as ThemeIcon component
</Text>
</Timeline.Item>
</Timeline>
</div>
);
}