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

# Multiple Recommendation Card – Code

> MultipleRecommendationCard presents a multi-select choice using checkboxes.

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

> [tab] Implementation
>
> ext-atlas-multiple-recommendation-card-demo
>
> [StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ext-atlas-multiple-recommendation-card-demo?file=src/App.tsx)
>
> ```tsx lines expandable theme={null}
> import { MultipleRecommendationCard } from "@servicetitan/anvil2-ext-atlas";
> import { Card } from "@servicetitan/anvil2";
>
> function App() {
>   return (
>     <Card
>       flexDirection="column"
>       gap={4}
>       background="strong"
>       style={{ width: "388px" }}
>     >
>       <MultipleRecommendationCard
>         message="Select all services you need:"
>         options={[
>           {
>             id: "option1",
>             label: "HVAC Maintenance",
>             description: "Regular maintenance check for your HVAC system",
>           },
>           {
>             id: "option2",
>             label: "Plumbing Repair",
>             description: "Fix any plumbing issues in your home",
>           },
>           {
>             id: "option3",
>             label: "Electrical Work",
>             description: "Electrical repairs and installations",
>           },
>         ]}
>         actions={[
>           { id: "confirm", name: "Confirm", type: "primary" },
>           { id: "cancel", name: "Cancel", type: "secondary" },
>         ]}
>         onSubmit={(data) => console.log("submitted:", data)}
>       />
>     </Card>
>   );
> }
>
> export default App;
> ```
>
> ## Common Examples
>
> ### Basic Usage
>
> Present a multi-select choice:
>
> ```tsx theme={null}
> import { MultipleRecommendationCard } from "@servicetitan/anvil2-ext-atlas";
>
> function MultiSelectExample() {
>   const handleSubmit = (response) => {
>     console.log("Selected options:", response.optionIds);
>   };
>
>   return (
>     <MultipleRecommendationCard
>       recommendationId="rec-456"
>       message="Select the issues you're experiencing:"
>       options={[
>         { id: "opt-1", label: "Water heater issues" },
>         { id: "opt-2", label: "Low water pressure" },
>         { id: "opt-3", label: "Drainage problems" },
>         { id: "opt-4", label: "Fixture leaks" },
>       ]}
>       actions={[
>         { id: "submit", name: "Submit", type: "primary" },
>       ]}
>       onSubmit={handleSubmit}
>     />
>   );
> }
> ```
>
> ### With Multiple Actions
>
> Include cancel option:
>
> ```tsx theme={null}
> import { MultipleRecommendationCard } from "@servicetitan/anvil2-ext-atlas";
>
> function MultiSelectWithCancel() {
>   return (
>     <MultipleRecommendationCard
>       recommendationId="rec-456"
>       message="Select all that apply:"
>       options={options}
>       actions={[
>         { id: "submit", name: "Submit", type: "primary" },
>         { id: "skip", name: "Skip", type: "ghost" },
>       ]}
>       onSubmit={handleSubmit}
>     />
>   );
> }
> ```
>
> ### Submitted State
>
> Show previously selected values:
>
> ```tsx theme={null}
> import { MultipleRecommendationCard } from "@servicetitan/anvil2-ext-atlas";
>
> function SubmittedExample() {
>   return (
>     <MultipleRecommendationCard
>       recommendationId="rec-456"
>       message="Select the issues:"
>       options={options}
>       actions={actions}
>       onSubmit={() => {}}
>       submitted={true}
>       selected={["opt-1", "opt-3"]}
>     />
>   );
> }
> ```

> [tab] MultipleRecommendationCard API
>
> ```tsx theme={null}
> <MultipleRecommendationCard
>   recommendationId="rec-456"
>   message="Select options"
>   options={[
>     { id: "opt-1", label: "Option 1" },
>     { id: "opt-2", label: "Option 2" },
>   ]}
>   actions={[
>     { id: "submit", name: "Submit", type: "primary" },
>   ]}
>   onSubmit={handleSubmit}
>   submitted={false}
>   selected={[]}
> />
> ```
>
> ## `MultipleRecommendationCard` Props
>
> **actions** `RecommendationAction[]` *required*
>
> Array of action buttons with `id`, `name`, and optional `type`.
>
> **message** `string` *required*
>
> The prompt message to display above the options.
>
> **onSubmit** `(response: ConfirmationResponse) =\> void` *required*
>
> Callback fired when an action button is clicked. Receives `sourceMessageId`, `optionIds`, and `actionId`.
>
> **options** `Options[]` *required*
>
> Array of selectable options with `id`, `label`, and optional `description`.
>
> **recommendationId** `string`
>
> Unique identifier for this recommendation, included in the submit response.
>
> **selected** `string[]`
>
> Array of selected option IDs to display when `submitted` is true.
>
> **submitted** `boolean` (default: false)
>
> When true, disables all inputs and shows the selected state.

> [tab] Shared Types
>
> ## Options Interface
>
> ```tsx theme={null}
> interface Options {
>   id: string;
>   label: string;
>   description?: string;
>   value?: string;
> }
> ```
>
> ## 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.