MDK Logo
ReferenceUIComponents

Feedback Components

Alerts, toasts, notifications, and user feedback

Components for providing feedback and notifications to users.

Prerequisites

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

Components

@tetherto/mdk-react-devkit

Core alert

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

Contextual feedback banner for success, info, warning, and error messages. Supports icons, close button, an action slot, and an optional full-width banner mode.

Notes

  • Once closed via the ✕ button, the component returns null and cannot be reopened without unmounting/remounting.
  • Setting description automatically adds the mdk-alert--with-description modifier for extra spacing.

Example

/**
 * Runnable example for Alert.
 */
import { CoreAlert } from '@tetherto/mdk-react-devkit'

export const AlertExample = () => (
  <div className="mdk-example-col">
    <CoreAlert
      type="info"
      title="Informational"
      description="Your miner firmware update is ready to install."
      showIcon
    />
    <CoreAlert
      type="success"
      title="Success"
      description="Pool credentials updated successfully."
      showIcon
      closable
    />
    <CoreAlert
      type="warning"
      title="Warning"
      description="Hash rate dropped below threshold — check your connections."
      showIcon
    />
    <CoreAlert
      type="error"
      title="Error"
      description="Failed to connect to the pool. Verify your credentials."
      showIcon
      closable
    />
  </div>
)
@tetherto/mdk-react-devkit

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

AlarmContents

Body region of an alarm card listing the alert details and recommended next actions.

agent-ready

Props

PropTypeRequiredDefaultDescription
alarmsDataunknown--
onNavigate(path: string) => void--

AlarmRow

Single alarm-feed row with severity dot, timestamp, source device, and the alert message.

agent-ready

Props

PropTypeRequiredDefaultDescription
dataTimelineItemData--
onNavigate(path: string) => void--

CoreAlert

Inline alert banner with type-based icon, optional description, dismissible close button, and trailing action slot.

agent-ready

Props

PropTypeRequiredDefaultDescription
typeAlertType | undefined-Alert type
titleReact.ReactNode-Main message
descriptionReact.ReactNode-Additional description
showIconboolean | undefined-Show the type icon
iconReact.ReactNode-Custom icon (used when showIcon is true)
closableboolean | undefined-Makes the alert closable
onCloseReact.MouseEventHandler<HTMLButtonElement> | undefined-Called when close button is clicked
bannerboolean | undefined-Display as full-width banner (no border radius, no margin)
actionReact.ReactNode-Action element rendered to the right
classNamestring | undefined-Custom className
styleReact.CSSProperties | undefined-Custom styles

EmptyState

Empty state component for displaying placeholder content when no data is available.

agent-ready

Props

PropTypeRequiredDefaultDescription
descriptionReact.ReactNode-Description text or ReactNode displayed below the image
imageEmptyStateImage"default"Image to display. Use "default" for the standard illustration, "simple" for a minimal icon, or pass a custom ReactNode.
sizeComponentSize | undefined"md"Size variant controlling spacing and icon dimensions
classNamestring | undefined-Additional CSS class name

ErrorCard

Error card component for displaying error messages.

agent-ready

Props

PropTypeRequiredDefaultDescription
errorstring-Error message string. Supports \\n for line breaks.
titlestring | undefined"Errors"Title displayed above the error message
variantErrorCardVariant | undefined"card"Display variant. "card" shows a bordered container, "inline" shows flat text.
classNamestring | undefined-Additional CSS class name

Loader

Loader component - display pulsing dots animation

agent-ready

Props

PropTypeRequiredDefaultDescription
sizenumber | undefined10Size of each dot in pixels
count3 | 5 | 7 | undefined5Number of dots to display
color"red" | "gray" | "blue" | "amber" | "orange" | undefined'orange'Color variant of the loader
classNamestring | undefined-Custom className for the root element

SkeletonBlock

Rectangular shimmer placeholder used to hint at content shape while data is loading.

agent-ready

Props

PropTypeRequiredDefaultDescription
circleboolean--
classNamestring--
widthstring | number--
heightstring | number--
borderRadiusstring | number--

Spinner

Spinner component - display loading state with rotating squares

agent-ready

Props

PropTypeRequiredDefaultDescription
sizeComponentSize | undefined'md'Size variant of the spinner
color"primary" | "secondary" | undefined'primary'Color variant of the spinner
fullScreenboolean | undefinedfalseWhether to display in fullscreen mode
classNamestring | undefined-Custom className for the root element
labelstring | undefined-Optional label text to display below the spinner
speed"slow" | "normal" | "fast" | undefined'normal'Speed of the animation
type"circle" | "square" | undefined'dot'Type of spinner animation

Toast

Single transient notification rendered inside the <Toaster> viewport. Use variant to convey intent (default, success, error, warning, info); pair with <ToastTitle> and <ToastDescription> for structured content, or wrap a <ToastAction> for a single inline call-to-action. Most apps will trigger toasts imperatively via the useToast hook rather than mounting <Toast> directly.

agent-ready

Props

PropTypeRequiredDefaultDescription
descriptionstring | undefined--
variantNotificationVariant | undefined--
iconReact.JSX.Element | undefined--

Toaster

Top-level provider + viewport that hosts every toast triggered via useToast. Mount once near the root of your app (typically inside <MdkProvider>). Without a <Toaster> in the tree, useToast calls are no-ops. Position and visual stacking are controlled by CSS tokens; no props are required for the default bottom-right placement.

agent-ready

Props

PropTypeRequiredDefaultDescription
positionToastPosition | undefined--

On this page