# @salmonui/layout/timeline API reference

> 6 exported symbols of @salmonui/layout/timeline: 2 functions, 3 interfaces and 1 type.

Canonical: https://salmonui.dev/docs/reference/layout/timeline

```ts
import { … } from '@salmonui/layout/timeline';
```

## Functions

### Timeline

Kind: function

Page: https://salmonui.dev/docs/reference/layout/timeline/Timeline

```ts
function Timeline(props: TimelineProps): ReactElement;

namespace Timeline {
    export { TimelineItem as Item };
}
```

Timeline (`.salmon-timeline`, `data-orientation`, `data-align`).

### TimelineItem

Kind: function

Page: https://salmonui.dev/docs/reference/layout/timeline/TimelineItem

```ts
function TimelineItem(props: TimelineItemProps): ReactElement;
```

One item (`.salmon-timeline-item`): opposite content, the marker with its connector, the content.

## Interfaces

### TimelineItemData

Kind: interface

Page: https://salmonui.dev/docs/reference/layout/timeline/TimelineItemData

```ts
interface TimelineItemData {
    readonly content?: ReactNode;
    readonly opposite?: ReactNode;
    readonly marker?: ReactNode;
    readonly tone?: TimelineTone | undefined;
    readonly disabled?: boolean | undefined;
    readonly className?: string | undefined;
    readonly key?: string | number | undefined;
}
```

One entry of the `items` array.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `content` | `readonly content?: ReactNode;` | optional |  |
| `opposite` | `readonly opposite?: ReactNode;` | optional | Content on the other side of the marker. |
| `marker` | `readonly marker?: ReactNode;` | optional | Replaces the default dot (an icon, an avatar). |
| `tone` | `readonly tone?: TimelineTone \| undefined;` | optional |  |
| `disabled` | `readonly disabled?: boolean \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `key` | `readonly key?: string \| number \| undefined;` | optional | React key; default the index. |

### TimelineItemProps

Kind: interface

Page: https://salmonui.dev/docs/reference/layout/timeline/TimelineItemProps

```ts
interface TimelineItemProps extends Omit<LiHTMLAttributes<HTMLLIElement>, 'content'> {
    readonly children?: ReactNode;
    readonly opposite?: ReactNode;
    readonly marker?: ReactNode;
    readonly tone?: TimelineTone | undefined;
    readonly disabled?: boolean | undefined;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `children` | `readonly children?: ReactNode;` | optional |  |
| `opposite` | `readonly opposite?: ReactNode;` | optional |  |
| `marker` | `readonly marker?: ReactNode;` | optional |  |
| `tone` | `readonly tone?: TimelineTone \| undefined;` | optional | Default `'neutral'`. |
| `disabled` | `readonly disabled?: boolean \| undefined;` | optional | Muted style and `aria-disabled`. |

### TimelineProps

Kind: interface

Page: https://salmonui.dev/docs/reference/layout/timeline/TimelineProps

```ts
interface TimelineProps extends HTMLAttributes<HTMLOListElement> {
    readonly items?: readonly TimelineItemData[] | undefined;
    readonly renderItem?: ((item: TimelineItemData, state: {
        index: number;
        first: boolean;
        last: boolean;
    }) => ReactNode) | undefined;
    readonly children?: ReactNode;
    readonly orientation?: 'vertical' | 'horizontal' | undefined;
    readonly align?: 'start' | 'end' | 'alternate' | 'alternateReverse' | undefined;
    readonly reverse?: boolean | undefined;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `items` | `readonly items?: readonly TimelineItemData[] \| undefined;` | optional | Data form of the items; wins over `children`. |
| `renderItem` | `readonly renderItem?: ((item: TimelineItemData, state: {     index: number;     first: boolean;     last: boolean; }) => ReactNode) \| undefined;` | optional | Renders each `items` entry; default its `content`. |
| `children` | `readonly children?: ReactNode;` | optional | `Timeline.Item` children. |
| `orientation` | `readonly orientation?: 'vertical' \| 'horizontal' \| undefined;` | optional | Default `'vertical'`. |
| `align` | `readonly align?: 'start' \| 'end' \| 'alternate' \| 'alternateReverse' \| undefined;` | optional | Side of the content relative to the line: `'end'` (default), `'start'`, `'alternate'`, `'alternateReverse'`; logical, follows `dir`. |
| `reverse` | `readonly reverse?: boolean \| undefined;` | optional | Reverses the DOM order, so reading order matches the visual order. |

## Types

### TimelineTone

Kind: type

Page: https://salmonui.dev/docs/reference/layout/timeline/TimelineTone

```ts
type TimelineTone = 'neutral' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
```
