Skip to main content

partner

Namespace for adding and removing accessory buttons in the top navigation bar. Button tap callbacks are registered via tdsEvent.addEventListener("navigationAccessoryEvent", callback).

Methods

MethodReturn typePurpose
partner.addAccessoryButtonPromise<void>Add an accessory button to the top navigation bar.
partner.removeAccessoryButtonPromise<void>Remove the accessory button from the top navigation bar.

Permission

No permission required — the partner namespace methods are not bound to any PermissionName and do not expose getPermission() / openPermissionDialog() helpers. For how other namespaces handle permissions, see Guides — Permissions pattern.

Event integration

After adding a button with addAccessoryButton, tapping it fires a navigationAccessoryEvent on tdsEvent. Register a listener with tdsEvent.addEventListener:

import { partner, tdsEvent } from '@apps-in-toss/web-framework';

// Add the button
await partner.addAccessoryButton({
id: 'my-button',
title: 'Favorite',
icon: { name: 'icon-star-mono' },
});

// Listen for taps
tdsEvent.addEventListener('navigationAccessoryEvent', (event) => {
if (event.id === 'my-button') {
console.log('Accessory button tapped');
}
});

UX guidance

  • Keep button IDs unique. Calling addAccessoryButton with the same ID again may overwrite the previous button.
  • Clean up when leaving the screen. Not calling removeAccessoryButton can leave the button visible on other screens. Handle cleanup in the useEffect return function.
  • Use design-system icon tokens for icon.name. An unrecognized name may render as an empty icon.

Try it live

Both methods are available on the Partner page in sdk-example.

Open in sdk-example

External references