> ## Documentation Index
> Fetch the complete documentation index at: https://anvil.servicetitan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Small Action – Code

> SmallAction displays quick accept/reject prompts for recommendations.

> [!WARNING]
>
> Atlas is deprecated. Use [AI Kit](https://anvil.servicetitan.com/docs/building-agentic-experiences) for any new Atlas experiences.

> [tab] Implementation
>
> ext-atlas-small-action-demo
>
> [StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ext-atlas-small-action-demo?file=src/App.tsx)
>
> ```tsx lines expandable theme={null}
> import { SmallAction } from "@servicetitan/anvil2-ext-atlas";
> import { Card } from "@servicetitan/anvil2";
>
> function App() {
>   return (
>     <Card
>       flexDirection="column"
>       gap={4}
>       background="strong"
>       style={{ width: "388px" }}
>     >
>       <SmallAction
>         recommendationId="rec-123"
>         message="Would you like to proceed with this action?"
>         description="This action will update your account settings."
>         onReject={() => console.log("rejected")}
>         onAccept={() => console.log("accepted")}
>       />
>     </Card>
>   );
> }
>
> export default App;
> ```
>
> ## Common Examples
>
> ### Basic Usage
>
> Quick action prompt:
>
> ```tsx theme={null}
> import { SmallAction } from "@servicetitan/anvil2-ext-atlas";
>
> function SmallActionExample() {
>   return (
>     <SmallAction
>       recommendationId="rec-123"
>       message="Would you like to apply this discount?"
>       description="10% off for returning customers"
>       onAccept={(id) => applyRecommendation(id)}
>       onReject={(id) => dismissRecommendation(id)}
>     />
>   );
> }
> ```
>
> ### Without Description
>
> Simple action prompt:
>
> ```tsx theme={null}
> import { SmallAction } from "@servicetitan/anvil2-ext-atlas";
>
> function SmallActionSimple() {
>   return (
>     <SmallAction
>       recommendationId="rec-456"
>       message="Accept this recommendation?"
>       onAccept={(id) => handleAccept(id)}
>       onReject={(id) => handleReject(id)}
>     />
>   );
> }
> ```
>
> ### Disabled State
>
> Prevent user interaction:
>
> ```tsx theme={null}
> import { SmallAction } from "@servicetitan/anvil2-ext-atlas";
>
> function SmallActionDisabled() {
>   return (
>     <SmallAction
>       recommendationId="rec-789"
>       message="Processing your request..."
>       onAccept={handleAccept}
>       onReject={handleReject}
>       buttonDisabled
>     />
>   );
> }
> ```

> [tab] SmallAction API
>
> ```tsx theme={null}
> <SmallAction
>   recommendationId="rec-123"
>   message="Apply discount?"
>   description="10% off"
>   onAccept={handleAccept}
>   onReject={handleReject}
>   buttonDisabled={false}
> />
> ```
>
> ## `SmallAction` Props
>
> **message** `string` *required*
>
> The main prompt message.
>
> **onAccept** `(recommendationId: string) =\> void` *required*
>
> Callback fired when accept button is clicked.
>
> **onReject** `(recommendationId: string) =\> void` *required*
>
> Callback fired when reject button is clicked.
>
> **recommendationId** `string` *required*
>
> Unique identifier for this recommendation, passed to callbacks.
>
> **buttonDisabled** `boolean` (default: false)
>
> When true, disables both action buttons.
>
> **className** `string`
>
> Additional CSS class name for custom styling.
>
> **description** `string`
>
> Additional description text below the message.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.