MDK Logo

Filter

Filter controls, filter bars, and search filters

Components for filtering and searching data.

Prerequisites

  • Complete the installation

  • Add the dependency to your app's package.json
{
  "dependencies": {
    "@tetherto/mdk-react-devkit": "*",
    "@tetherto/mdk-react-adapter": "*",
    "@tetherto/mdk-ui-foundation": "*"
  }
}

Run npm install from the mdk/ui workspace root after your app is under apps/ so npm links workspace packages.

  • Import styles: import '@tetherto/mdk-react-devkit/styles.css'

Components

@tetherto/mdk-react-devkit

Import the public APIs on this page from @tetherto/mdk-react-devkit.

ListViewFilter

Toolbar of dropdown/checkbox filters that drive a list view; emits the active filter set to the parent

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/primitives/components/list-view-filter/index.tsx

Props

PropStatusType / OptionsDefaultDescription
onChangeRequired(selections: CascaderValue[]) => void-Callback when filters change
optionsRequiredCascaderOption[]-Cascader options for filtering
classNameOptionalstring-Custom className for the filter button
filterKeyOptionalstring"default"Optional key to force re-mounting the Cascader when filters change Useful if you want to reset the internal state of the Cascader when filters change
localFiltersOptionalLocalFilters-Current filter values as key-value pairs Example: { type: 'Antminer S19XP H', status: ['active', 'pending'] }

ReportTimeFrameSelector

Reporting-period selector with preset windows (1d / 7d / 30d / custom range)

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/report-time-frame-selector/report-time-frame-selector.tsx

Props

PropStatusType / OptionsDefaultDescription
dateRangeRequired[Date, Date]-Custom date range as a [start, end] tuple
presetTimeFrameRequirednumber | null-Selected preset in days (1, 7, 30); null means the custom range is active
setDateRangeRequired(value: [Date, Date]) => void-Update the custom date range
setPresetTimeFrameRequired(value: number | null) => void-Update the preset selection

TimeframeControls

Date-range picker for financial reporting pages — supports year, month, and week granularity via connected selects

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/timeframe-controls/timeframe-controls.tsx

Props

PropStatusType / OptionsDefaultDescription
dateRangeOptionalTimeframeControlsDateRange-Current date range
hintOptionalstring-Helper text below the controls
isMonthSelectVisibleOptionalbooleantrueShow month selector
isWeekSelectVisibleOptionalbooleantrueShow week selector
layoutOptional"horizontal" | "stacked""horizontal"Layout direction
onRangeChangeOptionalTimeframeControlsOnRangeChange-Called when the range changes
onResetOptionalVoidFunction-Called when the Reset button is clicked
onTimeframeTypeChangeOptional(type: TimeframeTypeValue) => void-Called when timeframe type changes
showResetButtonOptionalbooleanfalseShows the Reset button
timeframeTypeOptionalnull | "month" | "week" | "year"-Active timeframe type

TimeframeWeekFlatContent

Flat list of selectable week items for the TimeframeControls week selector

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/timeframe-controls/timeframe-controls-week-content.tsx

Props

PropStatusType / OptionsDefaultDescription
visibleWeeksRequiredWeek[]--

TimeframeWeekTreeContent

Hierarchical year → month → week tree for the TimeframeControls week selector

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/timeframe-controls/timeframe-controls-week-content.tsx

Props

PropStatusType / OptionsDefaultDescription
selectedMonthRequirednumber--
selectedYearRequirednumber--
timezoneRequiredstring--

On this page