MDK Logo

Device explorer

Hierarchical view of containers, racks, and miners with filtering, search, and selection

The device explorer is the primary navigation surface for browsing containers, racks, and miners. It combines a filter Cascader, a tag-based search, device-type tabs, and a selectable data table so operators can drill into fleet inventory.

Prerequisites

DeviceExplorer

Hierarchical view of containers, racks, and miners with filtering, search, and selection capabilities.

Import

import { DeviceExplorer } from '@tetherto/mdk-react-devkit/foundation'

Props

PropStatusTypeDefaultDescription
deviceTypeRequired'container' | 'miner' | 'cabinet'requiredCurrent view type
dataRequiredDevice[]noneArray of devices to display
filterOptionsRequiredDeviceExplorerFilterOption[]noneCascader filter options
searchOptionsRequiredDeviceExplorerSearchOption[]noneSearch autocomplete options
searchTagsRequiredstring[]noneCurrent search tags
onSearchTagsChangeRequiredfunctionnoneSearch tags change handler
onDeviceTypeChangeRequiredfunctionnoneDevice type tab change handler
onFiltersChangeRequiredfunctionnoneFilter change handler
selectedDevicesOptionalDataTableRowSelectionState{}Selected row state
onSelectedDevicesChangeOptionalfunctionnoneSelection change handler
renderActionOptionalfunctionnoneCustom action column renderer
getFormattedDateRequiredfunctionnoneDate formatter function
classNameOptionalstringnoneAdditional CSS class

Basic usage

<DeviceExplorer
  deviceType="container"
  data={containers}
  filterOptions={[
    { value: 'site-a', label: 'Site A' },
    { value: 'site-b', label: 'Site B' },
  ]}
  searchOptions={[
    { value: 'container-001', label: 'Container 001' },
  ]}
  searchTags={searchTags}
  onSearchTagsChange={setSearchTags}
  onDeviceTypeChange={setDeviceType}
  onFiltersChange={handleFilters}
  getFormattedDate={(date) => date.toLocaleDateString()}
/>

With selection

<DeviceExplorer
  deviceType="miner"
  data={miners}
  filterOptions={filterOptions}
  searchOptions={searchOptions}
  searchTags={[]}
  onSearchTagsChange={setSearchTags}
  onDeviceTypeChange={setDeviceType}
  onFiltersChange={handleFilters}
  selectedDevices={selected}
  onSelectedDevicesChange={setSelected}
  getFormattedDate={formatDate}
  renderAction={(device) => (
    <Button size="sm" onClick={() => viewDetails(device.id)}>
      View
    </Button>
  )}
/>

Styling

  • .mdk-device-explorer: Root element
  • .mdk-device-explorer__toolbar: Toolbar container
  • .mdk-device-explorer__toolbar__filter: Filter Cascader
  • .mdk-device-explorer__toolbar__search: Search input
  • .mdk-device-explorer__toolbar__tabs: Device type tabs
  • .mdk-device-explorer__toolbar__tabs-list: Tabs list container
  • .mdk-device-explorer__toolbar__tab-trigger: Individual tab trigger

Next steps

  • For selecting and acting on an individual device, see the details view pages.
  • For container-level controls alongside the explorer, see [ContainerControlsBox(../details-view/controls#containercontrolsbox) on the Controls page.

On this page