MDK Logo

Feedback

Alerts, toasts, notifications, and user feedback

Components for providing feedback and notifications to users.

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

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

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/alarm/alarm-contents/alarm-contents.tsx

Props

PropStatusType / OptionsDefaultDescription
alarmsDataRequiredunknown-Alert entries to render. Falls back to EmptyState when empty or falsy
onNavigateRequired(path: string) => void-Navigation callback forwarded to each AlarmRow for click-through routing

AlarmRow

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

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/alarm/alarm-row/alarm-row.tsx

Props

PropStatusType / OptionsDefaultDescription
dataRequiredTimelineItemData-The alarm entry to render
onNavigateRequired(path: string) => void-Called when the row is clicked; receives the alarm uuid as the path segment

CoreAlert

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

agent-ready

Source

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

Props

PropStatusType / OptionsDefaultDescription
actionOptionalReact.ReactNode-Action element rendered to the right
bannerOptionalbooleanfalseDisplay as full-width banner (no border radius, no margin)
classNameOptionalstring-Custom className
closableOptionalbooleanfalseShows an ✕ button; clicking it hides the alert
descriptionOptionalReact.ReactNode-Secondary/detail content shown below the title
iconOptionalReact.ReactNode-Custom icon (used when showIcon is true)
onCloseOptionalReact.MouseEventHandler<HTMLButtonElement>-Called when close button is clicked
showIconOptionalbooleanfalseRenders the type icon (or the icon override) before the content
styleOptionalReact.CSSProperties-Custom styles
titleOptionalReact.ReactNode-Main message
typeOptional"success" | "info" | "warning" | "error""info"Controls the color scheme and default icon

EmptyState

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

agent-ready

Source

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

Props

PropStatusType / OptionsDefaultDescription
descriptionRequiredReact.ReactNode-Description text or ReactNode displayed below the image
classNameOptionalstring-Additional CSS class name
imageOptionalEmptyStateImage"default"Image to display. Use "default" for the standard illustration, "simple" for a minimal icon, or pass a custom ReactNode
sizeOptional"sm" | "md" | "lg""md"Size variant controlling spacing and icon dimensions

ErrorCard

Error card component for displaying error messages

agent-ready

Source

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

Props

PropStatusType / OptionsDefaultDescription
errorRequiredstring-Error message string. Supports \\n for line breaks
classNameOptionalstring-Additional CSS class name
titleOptionalstring"Errors"Title displayed above the error message
variantOptional"inline" | "card""card"Display variant. "card" shows a bordered container, "inline" shows flat text

Loader

Loader component - display pulsing dots animation

agent-ready

Source

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

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Custom className for the root element
colorOptional"red" | "gray" | "blue" | "amber" | "orange""orange"Color variant of the loader
countOptional3 | 5 | 75Number of dots to display
inlineOptionalbooleanfalseRender as an inline activity indicator instead of a block loading state. The default reserves a fixed 200px so a panel standing in for absent content does not collapse and then jump. Inline, that height is wrong: it strands the dots ~100px below the thing they belong to and centers them against surrounding text, which reads as frozen
sizeOptionalnumber10Size of each dot in pixels

SkeletonBlock

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

agent-ready

Source

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

Props

PropStatusType / OptionsDefaultDescription
borderRadiusOptionalstring | number-Border radius; ignored when circle is true
circleOptionalbooleanfalseRenders a perfect circle using height as the diameter
classNameOptionalstring-Additional class for the element
heightOptionalstring | number-Height in pixels (number) or any CSS value (string)
widthOptionalstring | number-Width in pixels (number) or any CSS value (string)

Spinner

Spinner component - display loading state with rotating squares

agent-ready

Source

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

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Custom className for the root element
colorOptional"primary" | "secondary""primary"Color variant of the spinner
fullScreenOptionalbooleanfalseWhether to display in fullscreen mode
labelOptionalstring-Optional label text to display below the spinner
sizeOptional"sm" | "md" | "lg""md"Size variant of the spinner
speedOptional"slow" | "normal" | "fast""normal"Speed of the animation
typeOptional"circle" | "square""square"Type of spinner animation

Toast

Single transient notification rendered inside the <Toaster> viewport. Use variant to convey intent (success, info, warning, error); 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

Source

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

Props

PropStatusType / OptionsDefaultDescription
titleRequiredstring-Title shown at the top of the toast
descriptionOptionalstring-Body text
durationOptionalnumber-Auto-dismiss after N ms
iconOptionalReact.JSX.Element-Override the default variant icon
onOpenChangeOptional((open: boolean) => void)-Open-state change handler
openOptionalboolean-Controlled open state
variantOptional"success" | "info" | "warning" | "error""info"Determines the icon and accent

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 top-left placement

agent-ready

Source

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

Props

PropStatusType / OptionsDefaultDescription
childrenRequiredReact.ReactNode-The <Toast> elements to render
positionOptional"top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center""top-left"Where the viewport is anchored

On this page