MDK Logo
ReferenceUI KitReactUI Kit foundationComponentsDashboard

TimelineSelector

Dropdown for picking the dashboard time range. Wraps `core/Select` and the canonical option list from `getTimelineOptions`. Pair with the `useDashboardTimeRa…

Dropdown for picking the dashboard time range. Wraps core/Select and the canonical option list from getTimelineOptions. Pair with the useDashboardTimeRange hook in @tetherto/mdk-react-adapter.

import { TimelineSelector } from "@tetherto/mdk-react-devkit";
PropStatusTypeDefaultDescription
valueRequiredstringCurrently selected timeline value (e.g. `'1m'`, `'5m'`).
onChangeRequired(next: string) => voidCalled whenever the user picks a new option.
optionsOptionalTimelineOption[] | undefinedAvailable options — defaults to {@link getTimelineOptions}. Pass a custom list to localise labels or restrict the range.
labelOptionalstring | undefinedARIA label / placeholder for the trigger.
classNameOptionalstring | undefinedTailwind/BEM class hook on the trigger.

Usage

Dropdown for picking the dashboard time range — wraps core/Select with the canonical option list from getTimelineOptions. Pair with useDashboardTimeRange from @tetherto/mdk-react-adapter to drive the hashrate / consumption / power-mode chart hooks.

Example

/** * Runnable example for TimelineSelector. * * Controlled component — owns its `value` and reacts to `onChange`. Pair * with `useDashboardTimeRange` from `@tetherto/mdk-react-adapter` in a * real dashboard. */import { TimelineSelector } from '@tetherto/mdk-react-devkit'import { useState } from 'react'export const TimelineSelectorExample = () => {  const [value, setValue] = useState('5m')  return <TimelineSelector value={value} onChange={setValue} />}