MDK Logo

Settings

Settings panels and preference controls

Components for settings and configuration interfaces.

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

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

AddUserModal

Modal form for inviting a new user — captures email, role, and optional team assignment

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/settings/add-user-modal/add-user-modal.tsx

Props

PropStatusType / OptionsDefaultDescription
onCloseRequiredVoidFunction-Called when the user dismisses the modal (cancel or backdrop)
onSubmitRequired(data: { name: string; email: string; role: string; }) => Promise<void>-Async handler called with validated form values on submission
openRequiredboolean-Controls whether the dialog is visible
rolesRequiredRoleOption[]-List of assignable roles rendered in the role select drop-down
isSubmittingOptionalbooleanfalseDisables the submit button and shows a loading label while the parent is saving

ChangeConfirmationModal

Generic confirmation modal that shows a diff or summary of pending changes before applying them

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/settings/change-confirmation-modal/change-confirmation-modal.tsx

Props

PropStatusType / OptionsDefaultDescription
childrenRequiredReact.ReactNode-Body content — use to describe the change being confirmed
onCloseRequiredVoidFunction-Called when the user cancels or dismisses the dialog
onConfirmRequiredVoidFunction-Called when the user clicks the confirm button
openRequiredboolean-Controls whether the dialog is visible
titleRequiredstring-Dialog header title
confirmTextOptionalstring"Confirm"Label for the confirm button
destructiveOptionalbooleanfalseWhen true, the confirm button uses the danger variant

FeatureFlagsSettings

Settings panel listing every feature flag with per-flag enable/disable toggle and description

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/settings/feature-flags/feature-flags-settings.tsx

Props

PropStatusType / OptionsDefaultDescription
featureFlagsRequiredRecord<string, boolean>-Current flag values keyed by flag name
isEditingEnabledRequiredboolean-Whether editing is permitted
onSaveRequired(flags: Record<string, boolean>) => void-Called with updated flags when saved
classNameOptionalstring-Additional CSS class
isLoadingOptionalbooleanfalseShow loading state
isSavingOptionalbooleanfalseShow saving spinner on save button

HeaderControlsSettings

Settings panel for the global app header — toggle controls, sticky behaviour, and theme defaults

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/settings/header-controls/header-controls-settings.tsx

Props

PropStatusType / OptionsDefaultDescription
onResetRequiredVoidFunction-Reset all preferences to defaults
onToggleRequired(key: keyof HeaderPreferences, value: boolean) => void-Called when a preference toggle changes
preferencesRequiredHeaderPreferences-Current header preference values
classNameOptionalstring-Additional CSS class
isLoadingOptionalbooleanfalseShow loading state

ImportExportSettings

Settings panel for exporting site configuration as JSON and importing a previously saved snapshot

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/settings/import-export/import-export-settings.tsx

Props

PropStatusType / OptionsDefaultDescription
onExportRequiredVoidFunction-Trigger configuration export
onImportRequired(data: SettingsExportData) => void-Apply imported configuration
classNameOptionalstring-Additional CSS class
isExportingOptionalbooleanfalseShow export loading state
isImportingOptionalbooleanfalseShow import loading state
onParseFileOptional((file: File) => Promise<SettingsExportData>)-Custom file-parsing function

ManageUserModal

Modal for editing an existing user's role, status, or team membership

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/settings/manage-user-modal/manage-user-modal.tsx

Props

PropStatusType / OptionsDefaultDescription
onCloseRequiredVoidFunction-Called when the dialog closes
onSubmitRequired(data: { id: string; name: string; email: string; role: string; }) => Promise<void>-Save handler
openRequiredboolean-Controls dialog visibility
permissionLabelsRequiredRecord<string, string>-Display labels for permission keys
rolePermissionsRequiredRecord<string, Record<string, PermLevel>>-Permission levels per role
rolesRequiredRoleOption[]-Available role options
userRequiredSettingsUser-The user being edited
isSubmittingOptionalbooleanfalseShow loading on submit button

RBACControlSettings

Settings panel listing roles and their permissions; supports editing role-permission grants

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/settings/rbac-control/rbac-control-settings.tsx

Props

PropStatusType / OptionsDefaultDescription
canWriteRequiredboolean-Whether the current user may edit access settings
onCreateUserRequired(data: { name: string; email: string; role: string; }) => Promise<void>-Create a new user
onDeleteUserRequired(userId: string) => Promise<void>-Delete a user
onUpdateUserRequired(data: { id: string; name: string; email: string; role: string; }) => Promise<void>-Update an existing user's role
permissionLabelsRequiredRecord<string, string>-Display labels for permission keys
rolePermissionsRequiredRecord<string, Record<string, PermLevel>>-Permission levels per role
rolesRequiredRoleOption[]-Available role options
usersRequiredSettingsUser[]-List of current users
classNameOptionalstring-Additional CSS class
isLoadingOptionalbooleanfalseShow loading state

SettingsDashboard

Top-level settings landing page — composes the per-section settings cards in a single grid

agent-ready

Source

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

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Additional CSS class
dangerActionsOptionalActionButtonProps[]-Danger-zone action buttons (reset, delete)
featureFlagsPropsOptionalFeatureFlagsSettingsProps-Props forwarded to FeatureFlagsSettings
headerControlsPropsOptionalHeaderControlsSettingsProps-Props forwarded to HeaderControlsSettings
importExportPropsOptionalImportExportSettingsProps-Props forwarded to ImportExportSettings
rbacControlPropsOptionalRBACControlSettingsProps-Props forwarded to RBACControlSettings
showFeatureFlagsOptionalbooleanfalseWhether to show the feature-flags section

On this page