> ## 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.

# Confirmation Card – Code

> ConfirmationCard presents a simple confirmation prompt with action buttons.

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

> [tab] Implementation
>
> ext-atlas-confirmation-card-demo
>
> [StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ext-atlas-confirmation-card-demo?file=src/App.tsx)
>
> ```tsx lines expandable theme={null}
> import { ConfirmationCard } from "@servicetitan/anvil2-ext-atlas";
> import { Card } from "@servicetitan/anvil2";
>
> function App() {
>   return (
>     <Card
>       flexDirection="column"
>       gap={4}
>       background="strong"
>       style={{ width: "388px" }}
>     >
>       <ConfirmationCard
>         recommendationId="confirmation-example"
>         message="Schedule Emergency Service"
>         description="This will schedule an emergency service call within 2 hours. Additional fees may apply."
>         actions={[
>           { id: "confirm", name: "Schedule Now", type: "primary" },
>           { id: "cancel", name: "Cancel", type: "secondary" },
>         ]}
>         onSubmit={(data) => console.log("submitted:", data)}
>       />
>     </Card>
>   );
> }
>
> export default App;
> ```
>
> ## Common Examples
>
> ### Basic Usage
>
> Simple confirmation prompt:
>
> ```tsx theme={null}
> import { ConfirmationCard } from "@servicetitan/anvil2-ext-atlas";
>
> function ConfirmationExample() {
>   return (
>     <ConfirmationCard
>       recommendationId="rec-789"
>       message="Would you like to proceed with this booking?"
>       description="Your appointment will be scheduled for tomorrow at 2:00 PM"
>       actions={[
>         { id: "confirm", name: "Confirm Booking", type: "primary" },
>         { id: "reschedule", name: "Choose Different Time", type: "secondary" },
>       ]}
>       onSubmit={(response) => handleAction(response)}
>     />
>   );
> }
> ```
>
> ### With Link Action
>
> Include a navigation link:
>
> ```tsx theme={null}
> import { ConfirmationCard } from "@servicetitan/anvil2-ext-atlas";
>
> function ConfirmationWithLink() {
>   return (
>     <ConfirmationCard
>       recommendationId="rec-789"
>       message="Ready to book your service?"
>       actions={[
>         { id: "confirm", name: "Confirm", type: "primary" },
>         { id: "cancel", name: "Cancel", type: "ghost" },
>         { id: "learn-more", name: "Learn More", type: "link", url: "/help/booking" },
>       ]}
>       onSubmit={(response) => handleAction(response)}
>     />
>   );
> }
> ```
>
> ### Submitted State
>
> Show disabled state after submission:
>
> ```tsx theme={null}
> import { ConfirmationCard } from "@servicetitan/anvil2-ext-atlas";
>
> function SubmittedExample() {
>   return (
>     <ConfirmationCard
>       recommendationId="rec-789"
>       message="Booking confirmed!"
>       description="Your appointment has been scheduled."
>       actions={actions}
>       onSubmit={() => {}}
>       submitted={true}
>     />
>   );
> }
> ```

> [tab] ConfirmationCard API
>
> ```tsx theme={null}
> <ConfirmationCard
>   recommendationId="rec-789"
>   message="Confirm action?"
>   description="Additional details"
>   actions={[
>     { id: "confirm", name: "Confirm", type: "primary" },
>     { id: "cancel", name: "Cancel", type: "ghost" },
>   ]}
>   onSubmit={handleSubmit}
>   submitted={false}
> />
> ```
>
> ## `ConfirmationCard` Props
>
> **actions** `RecommendationAction[]` *required*
>
> Array of action buttons. Supports `type: "link"` with `url` for navigation.
>
> **message** `string` *required*
>
> The main prompt message to display.
>
> **onSubmit** `(response: ConfirmationResponse) =\> void` *required*
>
> Callback fired when an action is clicked. For link actions, includes `url` in parameters.
>
> **className** `string`
>
> Additional CSS class name for custom styling.
>
> **description** `string`
>
> Additional description text displayed in the card.
>
> **recommendationId** `string`
>
> Unique identifier for this recommendation, included in the submit response.
>
> **submitted** `boolean` (default: false)
>
> When true, disables all action buttons.

> [tab] Shared Types
>
> ## RecommendationAction Interface
>
> ```tsx theme={null}
> interface RecommendationAction {
>   id: string;
>   name: string;
>   type?: "primary" | "secondary" | "ghost" | "danger" | "link";
>   url?: string;
> }
> ```
>
> ## ConfirmationResponse Interface
>
> ```tsx theme={null}
> interface ConfirmationResponse {
>   sourceMessageId?: string;
>   optionIds: string[];
>   actionId: string;
>   parameters?: Record<string, string | number | undefined>;
> }
> ```


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