interface

AdminPlugin

A Go plugin’s exported collection of admin field editors, pages, and other components.

Example

ts
import {
  defineAdminPlugin,
  definePluginField
} from '@riducms/plugin/authoring/v1';
import ColorField from './color-field.svelte';
import { decodeColor } from './value';

export const colorAdminPlugin = defineAdminPlugin({
  key: 'color',
  pairingVersion: 1,
  fields: {
    color: definePluginField({
      component: ColorField,
      decodeValue: decodeColor
    })
  }
});

Properties

PropertyTypeDescription
apiVersion1Added by defineAdminPlugin from the versioned import. Do not set this yourself.
keystringRequired. Match the Go plugin’s Key(), for example color or editorial-tools. Use a lowercase key with hyphens between words.
pairingVersionnumberRequired positive integer. Match Admin.PairingVersion in the Go descriptor. Increase it when an older Go or admin package would no longer work with the other.
fieldsReadonly<Record<string, RegisteredPluginField & { readonly type: "plugin"; readonly fieldType?: never; }>>Optional. Map Go field-type keys to definePluginField results. These become the default editors for those new field types; the keys match PluginFieldType.Key in Go.
fieldEditorsReadonly<Record<string, RegisteredPluginField & ({ readonly type: Exclude<FieldType, "plugin">; } | { readonly type: "plugin"; readonly fieldType: string; })>>Optional. Map component names to defineFieldComponent results. Go chooses an alternative editor with field.PluginComponent(pluginKey, componentName).
rowLabelsreadonly RowLabelPlugin[]Optional. Row headings made with defineRowLabelPlugin. Go selects them with field.PluginComponent in Admin.RowLabel.
messagesPluginMessageCatalogOptional. Translations bundled with the plugin, created with defineAdminMessages.
assetsreadonly string[]Optional. Package-relative modules or styles imported during the admin build. Keep the list and order identical to Admin.Assets in the Go descriptor.
routesreadonly AdminRoute[]Optional. Add pages inside the admin, each with a relative path, component, and optional navigation link. Plugin routes must also appear in the Go descriptor.
dashboardPanelsreadonly AdminDashboardPanel[]Optional. Add panels before or after the dashboard, or replace it. Each entry names a key, component, and position; the default position is after.
loginreadonly AdminLoginComponent[]Optional. Add content before or after sign-in, or replace the screen. A replacement can render defaultView to retain the login form.
accountreadonly AdminAccountComponent[]Optional. Add content to or replace the profile or security screen, selected by surface.
navigationreadonly AdminNavigationComponent[]Optional. Add content around the navigation links or replace navigation. Use routes for a new page with its own navigation link.
logoutButtonAdminLogoutButtonOptional. Replace the account menu’s sign-out control. The component receives host.logout() to end the session.
coreViewsreadonly AdminCoreView[]Optional. Wrap or replace collection lists, create/edit forms, global editors, or the not-found page. The component can render defaultView to keep the built-in screen.
brandingreadonly AdminBrandComponent[]Optional. Replace the login logo, navigation logo, or account avatar. Each location accepts one replacement.
shellSlotsreadonly AdminShellSlot[]Optional. Add a component to the header, global actions, or account settings menu.
providersreadonly AdminProvider[]Optional. Share context between components by wrapping the admin. The first provider is outermost; every provider must render defaultView.
listCellRenderersreadonly AdminListCellRenderer[]Optional. Change how a field appears in a collection table. Each entry selects a collection, field path, and component.
listResultsRenderersreadonly AdminListResultsRenderer[]Replace only the results layout; Ridu retains list loading, controls and pagination.
documentActionsreadonly AdminDocumentAction[]Optional. Add buttons to saved collection documents. A component implements the action; an optional requires permission hides it when the user lacks that permission.
documentViewsreadonly AdminDocumentView[]Optional. Add tabs beside Edit and API on saved documents or globals. Each entry includes a key, label, and component; collection can limit where it appears.

How it works

Use the linked registration helper to create this value. Component arrays keep their order; installed plugin entries come before application entries. Each replacement location accepts one component.

Full signature

Related guides