Skip to main content

AdminAction

AdminAction is a component used by Admin action extensions to configure a primary and secondary action and title. Use of this component is required in order to use Admin action extensions.

boolean

Sets the loading state of the action modal

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.

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.

Was this section helpful?

Set the primary and secondary action of the Action modal.

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

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

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

Preview