MDK Logo

Navigation

Sidebars, tabs, breadcrumbs, and navigation menus

Components for application navigation.

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 { Breadcrumbs } from '@tetherto/mdk-react-devkit'

Horizontal breadcrumb navigation. Renders an ordered trail of links / buttons / plain labels with an optional "Back" button on the left.

Notes

  • The last item is rendered as the current page (aria-current="page")
  • Items without href or onClick render as plain text
/**
 * Runnable example for Breadcrumbs.
 */
import { Breadcrumbs } from '@tetherto/mdk-react-devkit'

export const BreadcrumbsExample = () => (
  <Breadcrumbs
    showBack
    onBackClick={() => undefined}
    items={[
      { label: 'Dashboard', href: '/' },
      { label: 'Devices', onClick: () => undefined },
      { label: 'Miner #42' },
    ]}
  />
)
@tetherto/mdk-react-devkit

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

AppHeader

Generic top-bar shell with three slots: start, children (middle), and actions (end). Renders a sticky dark surface; consumers compose any content into the slots. The sidebar collapse toggle, brand logo, stats strip, and action buttons are all caller-provided — this component owns no domain

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/primitives/components/app-header/app-header.tsx

Props

PropStatusType / OptionsDefaultDescription
actionsOptionalReact.ReactNode-Right-edge action cluster — e.g. alarms bell, profile menu, or sign-out
childrenOptionalReact.ReactNode-Middle slot — e.g. the dashboard stats strip or page title
classNameOptionalstring-Optional class hook for the outer <header> element
logoOptionalReact.ReactNode-Left-most slot — typically the app's brand lockup / logo
startOptionalReact.ReactNode-Left-edge content — e.g. a sidebar collapse toggle or brand wordmark
stickyOptionalbooleantrueRender the header sticky to the top of its scroll container

Hierarchical navigation trail that renders the path of pages leading to the current view. Each item can be a link (href or onClick) or plain text; the last item is rendered as the current page. Pass showBack to prepend a "back" affordance for mobile/touch layouts. The separator between items is customisable via separator (defaults to /)

agent-ready

Source

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

Props

PropStatusType / OptionsDefaultDescription
itemsRequiredBreadcrumbItem[]-Ordered trail; the last item is rendered as current
backClassNameOptionalstring-Class names applied to the back button
backLabelOptionalstring"Back"Label for the back button
classNameOptionalstring-Root class names
itemClassNameOptionalstring-Class names applied to each item
onBackClickOptionalVoidFunction-Callback fired when the back button is clicked
separatorOptionalReact.ReactNode"/"Custom separator between items
showBackOptionalbooleanfalseShow a leading "Back" button

Pagination

Pagination component for navigating through pages

agent-ready

Source

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

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Custom className for the root element
currentOptionalnumber1Current active page number
disabledOptionalbooleanfalseDisable pagination
onChangeOptional((page: number, pageSize: number) => void)-Callback when page number or page size changes
onSizeChangeOptional((current: number, size: number) => void)-Callback when page size changes
pageSizeOptionalnumber20Number of items per page
pageSizeOptionsOptionalnumber[][10, 20, 50, 100]Page size options for the select dropdown
showSizeChangerOptionalbooleantrueShow page size changer
showTotalOptionalbooleanfalseShow total count text
sizeOptional"sm" | "md" | "lg""sm"Size variant
totalOptionalnumber0Total number of items

Application sidebar with collapsible state, persistent expansion (via localStorage), optional overlay mode, and item-click + active-item highlighting

agent-ready

Source

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

Props

PropStatusType / OptionsDefaultDescription
itemsRequiredSidebarMenuItem[]-Menu items (supports nested items)
activeIdOptionalstring-Currently active item id
classNameOptionalstring-Additional class names
defaultExpandedOptionalbooleanfalseInitial expanded state
expandedOptionalboolean-Controlled expanded state
headerOptionalReact.ReactNode-Header content (e.g. logo, app name)
onCloseOptionalVoidFunction-Called when the backdrop or ESC closes
onExpandedChangeOptional((expanded: boolean) => void)-Setter for the expanded state
onItemClickOptional((item: SidebarMenuItem) => void)-Item-click handler
overlayOptionalbooleanfalseShow as fixed overlay with backdrop
visibleOptionalbooleantrueHide entirely without unmounting

On this page