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 '@mdk/foundation'

Props

PropTypeDefaultDescription
deviceType'container' | 'miner' | 'cabinet'requiredCurrent view type
dataDevice[]requiredArray of devices to display
filterOptionsDeviceExplorerFilterOption[]requiredCascader filter options
searchOptionsDeviceExplorerSearchOption[]requiredSearch autocomplete options
searchTagsstring[]requiredCurrent search tags
onSearchTagsChange(tags: string[]) => voidrequiredSearch tags change handler
onDeviceTypeChange(type: DeviceExplorerDeviceType) => voidrequiredDevice type tab change handler
onFiltersChange(value: LocalFilters) => voidrequiredFilter change handler
selectedDevicesDataTableRowSelectionState{}Selected row state
onSelectedDevicesChange(selections: DataTableRowSelectionState) => voidnoneSelection change handler
renderAction(device: Device) => ReactNodenoneCustom action column renderer
getFormattedDate(date: Date) => stringrequiredDate formatter function
classNamestringnoneAdditional 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 on the Controls page.

On this page