diff --git a/packages/elements/__tests__/confirmation.test.tsx b/packages/elements/__tests__/confirmation.test.tsx
index 28342a2f..387a9d67 100644
--- a/packages/elements/__tests__/confirmation.test.tsx
+++ b/packages/elements/__tests__/confirmation.test.tsx
@@ -230,6 +230,22 @@ describe("confirmationActions", () => {
const actionsContainer = screen.getByText("Accept").parentElement;
expect(actionsContainer).toHaveClass("custom-class");
});
+
+ it("merges custom className on actions without dropping compact sizing", () => {
+ render(
+
+
+
+ Reject
+
+ Accept
+
+
+ );
+ const reject = screen.getByText("Reject");
+ expect(reject).toHaveClass("text-destructive", "h-8", "px-3", "text-sm");
+ expect(screen.getByText("Accept")).toHaveClass("h-8", "px-3", "text-sm");
+ });
});
describe("confirmationAccepted", () => {
diff --git a/packages/elements/src/confirmation.tsx b/packages/elements/src/confirmation.tsx
index 7c964383..2bd253f5 100644
--- a/packages/elements/src/confirmation.tsx
+++ b/packages/elements/src/confirmation.tsx
@@ -1,10 +1,11 @@
"use client";
+import type { ToolUIPart } from "ai";
+import type { ComponentProps, ReactNode } from "react";
+
import { Alert, AlertDescription } from "@repo/shadcn-ui/components/ui/alert";
import { Button } from "@repo/shadcn-ui/components/ui/button";
import { cn } from "@repo/shadcn-ui/lib/utils";
-import type { ToolUIPart } from "ai";
-import type { ComponentProps, ReactNode } from "react";
import { createContext, useContext, useMemo } from "react";
type ToolUIPartApproval =
@@ -164,6 +165,13 @@ export const ConfirmationActions = ({
export type ConfirmationActionProps = ComponentProps;
-export const ConfirmationAction = (props: ConfirmationActionProps) => (
-
+export const ConfirmationAction = ({
+ className,
+ ...props
+}: ConfirmationActionProps) => (
+
);