MDK Logo

Settings components

Pre-built settings UI components for administrative tasks

The @tetherto/mdk-foundation-ui package provides pre-built settings UI for common administrative tasks.

Either use:

  1. All-in-one dashboard (SettingsDashboard): renders all settings sections in collapsible accordions.
  2. Individual components: use FeatureFlagsSettings, HeaderControlsSettings, etc. directly for custom layouts.

Settings dashboard

The main container that renders settings sections in accordion panels.

Each section renders if you provide its props, giving you control over the sections you need.

import { SettingsDashboard } from '@tetherto/mdk-foundation-ui'

Props

PropTypeDefaultDescription
showFeatureFlagsbooleanfalseShow the feature flags section (requires featureFlagsProps)
headerControlsPropsHeaderControlsSettingsPropsnoneProps for header controls section
rbacControlPropsRBACControlSettingsPropsnoneProps for RBAC/user management section
importExportPropsImportExportSettingsPropsnoneProps for import/export section
featureFlagsPropsFeatureFlagsSettingsPropsnoneProps for feature flags section
dangerActionsActionButtonProps[]noneEntries forwarded to ActionButton (@tetherto/mdk-core-ui). See advanced usage for danger actions with confirmation.
classNamestringnoneAdditional CSS class

Basic usage

import { SettingsDashboard } from '@tetherto/mdk-foundation-ui'

function SettingsPage() {
  return (
    <SettingsDashboard
      headerControlsProps={{
        preferences: headerPrefs,
        onToggle: handleToggle,
        onReset: handleReset,
      }}
      rbacControlProps={{
        users,
        roles,
        rolePermissions,
        permissionLabels,
        canWrite: true,
        onCreateUser,
        onUpdateUser,
        onDeleteUser,
      }}
      importExportProps={{
        onExport: handleExport,
        onImport: handleImport,
        onParseFile: parseSettingsFile,
      }}
      dangerActions={[
        {
          label: 'Reboot system',
          variant: 'danger',
          confirmation: {
            title: 'Reboot system',
            description: 'This restarts device workers. Ensure no pending actions remain.',
            onConfirm: handleReboot,
          },
        },
      ]}
    />
  )
}

Advanced usage for danger actions with confirmation

Use dangerActions when you need high-impact controls below the Settings heading and above the accordion sections. Each item follows ActionButton props: at minimum label, variant, and a confirmation object. Set mode: 'dialog' for modal confirmations (for example two side-by-side danger actions).

<SettingsDashboard
  headerControlsProps={/* ... */}
  rbacControlProps={/* ... */}
  importExportProps={/* ... */}
  dangerActions={[
    {
      label: 'Restart orchestration',
      variant: 'danger',
      mode: 'dialog',
      confirmation: {
        title: 'Restart orchestration',
        description: (
          <p>
            Restarts orchestration workers. Ensure maintenance windows are respected.
          </p>
        ),
        onConfirm: () => {
          void restartOrchestration()
        },
      },
    },
    {
      label: 'Disable automation policy',
      variant: 'danger',
      mode: 'dialog',
      confirmation: {
        title: 'Disable automation policy',
        description:
          'Automated mitigations will stop until you re-enable the policy.',
        onConfirm: () => {
          void disableAutomationPolicy()
        },
      },
    },
  ]}
/>

Full ActionButton semantics (confirmation fields, mode, loading, etc.) live under Form components: ActionButton.

Accordion sections

The dashboard renders each settings section inside an Accordion component from @tetherto/mdk-core-ui:

Styling

The component uses the .mdk-settings-dashboard CSS class. Key selectors:

  • .mdk-settings-dashboard__title: main heading
  • .mdk-settings-dashboard__danger-actions: container for danger action buttons
  • .mdk-settings-dashboard__accordions: container for accordion sections

Individual components

Use these components directly when you need a custom layout or only one settings section:

ComponentDescription
SettingsDashboardMain settings container with accordion panels
FeatureFlagsSettingsAdd, toggle, and delete feature flags
HeaderControlsSettingsManage header visibility preferences
ImportExportSettingsBackup and restore settings
RBACControlSettingsUser management with RBAC
AddUserModalCreate new users
ManageUserModalModal to edit users
ChangeConfirmationModalConfirmation dialog

On this page