MDK Logo

Action

Buttons, action triggers, and export controls

Components for triggering actions and user interactions.

Prerequisites

  • Install the packages
npm install \
  @tetherto/mdk-react-devkit \
  @tetherto/mdk-react-adapter \
  @tetherto/mdk-ui-foundation

Install zod@^4.6.6 first. @tetherto/mdk-react-devkit@0.12.1 declares zod@^4.6.6 as a peer while its @hookform/resolvers peer pulls a chain that pins zod 3, so the command above aborts with ERESOLVE in a project that has no zod. Installing zod 4 at the project root resolves it:

npm install zod@^4.6.6
  • Import styles: import '@tetherto/mdk-react-devkit/styles.css'

Components

@tetherto/mdk-react-devkit

Button

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

Primary action button with variants, sizes, loading state, icon placement, and full-width layout. Forwards refs and all native <button> attributes.

Data contracts

ButtonVariant and ComponentSize are exported from core/types.

Notes

  • aria-busy is set when loading is true
  • When loading is true the inner spinner is the only child; icon and children are hidden.

Example

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

export const ButtonExample = () => (
  <div className="mdk-example-row">
    <Button variant="primary">Primary</Button>
    <Button variant="secondary">Secondary</Button>
    <Button variant="primary" loading>
      Submitting
    </Button>
    <Button variant="secondary" disabled>
      Disabled
    </Button>
    <Button variant="primary" size="sm">
      Small
    </Button>
    <Button variant="primary" size="lg">
      Large
    </Button>
  </div>
)
@tetherto/mdk-react-devkit

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

ActionButton

ActionButton component with confirmation popover or dialog

agent-ready

Source

src/primitives/components/action-button/USAGE.md

src/primitives/components/action-button/index.tsx

Props

PropStatusType / OptionsDefaultDescription
confirmationRequiredActionButtonConfirmation-Configuration for the confirmation UI
classNameOptionalstring-Additional class for the trigger button
disabledOptionalboolean-Disables the trigger button
labelOptionalstring-Button label text
loadingOptionalboolean-Shows a spinner on the trigger button
modeOptional"dialog" | "popover""popover"Confirmation mode: popover (inline) or dialog (modal)
variantOptional"primary" | "danger" | "secondary""secondary"Visual style of the trigger button
ActionButtonConfirmation
PropStatusType / OptionsDefaultDescription
titleRequiredstring-Heading shown in the confirmation UI
cancelLabelOptionalstring"Cancel"Label for the cancel button
confirmLabelOptionalstring'OK' (popover) / 'Confirm' (dialog)Label for the confirm button. Defaults to 'OK' in popover mode and 'Confirm' in dialog mode
descriptionOptionalReact.ReactNode-Body text or node shown below the title
iconOptionalReact.ReactNode<QuestionMarkCircledIcon>Icon shown in the popover header (popover mode only)
onCancelOptionalVoidFunction-Fired when the user cancels
onConfirmOptionalVoidFunction-Fired when the user confirms

Button

Primary action button. Supports loading state with spinner, icon placement, variants, sizes, and full-width layout. Forwards refs and all native button attributes

agent-ready

Source

src/primitives/components/button/USAGE.md

src/primitives/components/button/index.tsx

Props

PropStatusType / OptionsDefaultDescription
contentClassNameOptionalstring-Class names applied to the inner content wrapper
disabledOptionalbooleanfalseDisable the button
fullWidthOptionalbooleanfalseMake the button stretch to fill its container
iconOptionalReact.ReactNode-Icon node rendered alongside children
iconPositionOptional"left" | "right""left"Icon placement relative to children
loadingOptionalbooleanfalseShow a spinner instead of the content and disable the button
sizeOptional"sm" | "md" | "lg"-Size token (sm, md, lg)
typeOptional"button" | "submit" | "reset""button"Native button type
variantOptional"icon" | "link" | "primary" | "danger" | "secondary" | "tertiary" | "nav-link" | "outline" | "ghost""secondary"Visual variant (e.g. primary, secondary, ghost)

On this page