Skip to main content

    IntentButton

    The IntentButton is a dedicated component for sending intents. The IntentButton only works within the AppShell context.

    Import

    import { IntentButton } from '@dynatrace/strato-components-preview/buttons';

    Use cases

    The IntentButton component consists of a button label with a prefix icon, and a dropdown menu.

    CodeSandbox

    Display intents in a menu

    Use the IntentButton.Item compound component to automatically display additional intents in a menu. The main intent is the primary action on the root component, the <IntentButton>, itself.

    CodeSandbox

    Add payload to "Open with..."

    The IntentButton include an "Open with..." menu item as a default. "Open with..." opens an overlay listing suitable apps for users to choose from. To customize the payload prop (information that you want to share with the apps) use the IntentButton.OpenWith compound component. The label and icon for the "Open with..." menu item cannot be changed.

    CodeSandbox

    Intent with response

    The IntentButton supports intents that return data from intent actions. To receive a response, you must provide both the onResponse and the responseProperties prop. The responseProperties prop defines which properties the source app expects in the response; onResponse is the callback that handles the returned values.

    CodeSandbox
    Still have questions?
    Find answers in the Dynatrace Community