Skip to main content

AdminAction

AdminAction is a component used by Admin Action extensions to configure a primary and secondary action and title.

string

Sets the title of the Action container. If not provided, the name of the extension will be used. Titles longer than 40 characters will be truncated.

RemoteFragment

Sets the Primary action button of the container. This component must be a button component.

RemoteFragment

Sets the Secondary action button of the container. This component must be a button component.

boolean

Sets the loading state of the action modal

Was this section helpful?

Set the primary and secondary action of the Action modal.

import React from 'react';
import {reactExtension, AdminAction, Button} from '@shopify/ui-extensions-react/admin';

function App() {
return (
<AdminAction
title="My App Action"
primaryAction={<Button onPress={() => {}}>Action</Button>}
secondaryAction={<Button onPress={() => {}}>Secondary</Button>}
>
Modal content
</AdminAction>
);
}

export default reactExtension('Playground', () => <App />);

Preview