Action
Buttons, action triggers, and export controls
Components for triggering actions and user interactions.
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
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-busyis set whenloadingis true- When
loadingis true the inner spinner is the only child;iconandchildrenare 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
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
confirmation | Required | ActionButtonConfirmation | - | Configuration for the confirmation UI |
className | Optional | string | - | Additional class for the trigger button |
disabled | Optional | boolean | - | Disables the trigger button |
label | Optional | string | - | Button label text |
loading | Optional | boolean | - | Shows a spinner on the trigger button |
mode | Optional | "dialog" | "popover" | "popover" | Confirmation mode: popover (inline) or dialog (modal) |
variant | Optional | "primary" | "danger" | "secondary" | "secondary" | Visual style of the trigger button |
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
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
contentClassName | Optional | string | - | Class names applied to the inner content wrapper |
disabled | Optional | boolean | false | Disable the button |
fullWidth | Optional | boolean | false | Make the button stretch to fill its container |
icon | Optional | React.ReactNode | - | Icon node rendered alongside children |
iconPosition | Optional | "left" | "right" | "left" | Icon placement relative to children |
loading | Optional | boolean | false | Show a spinner instead of the content and disable the button |
size | Optional | "sm" | "md" | "lg" | - | Size token (sm, md, lg) |
type | Optional | "button" | "submit" | "reset" | "button" | Native button type |
variant | Optional | "icon" | "link" | "primary" | "danger" | "secondary" | "tertiary" | "nav-link" | "outline" | "ghost" | "secondary" | Visual variant (e.g. primary, secondary, ghost) |
StatsExport
Dropdown button that triggers asynchronous CSV or JSON export. Shows a spinner while the corresponding handler is awaited
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
onCsvExport | Required | () => Promise<void> | - | Awaited; spinner shown while pending |
onJsonExport | Required | () => Promise<void> | - | Awaited; spinner shown while pending |
disabled | Optional | boolean | false | Disable the trigger |
hideLabel | Optional | boolean | false | Hides the textual "Export" label |