MDK Logo
UI Kitreact-devkitComponentsCoreFeedback

CoreAlert

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

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

import { CoreAlert } from "@tetherto/mdk-react-devkit";
PropStatusTypeDefaultDescription
typeOptionalAlertType | undefinedAlert type
titleOptionalReact.ReactNodeMain message
descriptionOptionalReact.ReactNodeAdditional description
showIconOptionalboolean | undefinedShow the type icon
iconOptionalReact.ReactNodeCustom icon (used when showIcon is true)
closableOptionalboolean | undefinedMakes the alert closable
onCloseOptionalReact.MouseEventHandler<HTMLButtonElement> | undefinedCalled when close button is clicked
bannerOptionalboolean | undefinedDisplay as full-width banner (no border radius, no margin)
actionOptionalReact.ReactNodeAction element rendered to the right
classNameOptionalstring | undefinedCustom className
styleOptionalReact.CSSProperties | undefinedCustom styles

Usage

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>)