Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

docs: add Ask AI button to page actions

Sushmithamalleshc95b36454047
diff --git a/docs/components/ask-ai-button.tsx b/docs/components/ask-ai-button.tsx
index b1d8c6e64..053695f2b 100644
--- a/docs/components/ask-ai-button.tsx
+++ b/docs/components/ask-ai-button.tsx
@@ -13,7 +13,7 @@ function getDecimal() {
let widgetOpen = false;
-function toggleDecimalWidget() {
+export function toggleDecimalWidget() {
const decimal = getDecimal();
if (!decimal) {
setTimeout(() => {
diff --git a/docs/components/feedback.tsx b/docs/components/feedback.tsx
index 68581196d..42d017297 100644
--- a/docs/components/feedback.tsx
+++ b/docs/components/feedback.tsx
@@ -1,7 +1,7 @@
'use client';
import { useState, useRef, useEffect } from 'react';
-import { MessageSquare, X, Loader2 } from 'lucide-react';
+import { PenLine, X, Loader2 } from 'lucide-react';
type Sentiment = 'positive' | 'neutral' | 'negative' | null;
@@ -91,7 +91,7 @@ export function Feedback({ page }: FeedbackProps) {
motion-reduce:transition-none motion-reduce:active:scale-100"
aria-label="Share feedback about this page"
>
- <MessageSquare className="size-3.5" aria-hidden="true" />
+ <PenLine className="size-3.5" aria-hidden="true" />
<span>Feedback</span>
</button>
diff --git a/docs/components/page-actions.tsx b/docs/components/page-actions.tsx
index 38aba4621..8f6bebc9b 100644
--- a/docs/components/page-actions.tsx
+++ b/docs/components/page-actions.tsx
@@ -1,8 +1,9 @@
'use client';
import { useState, useCallback } from 'react';
-import { Copy, Check, Loader2, ExternalLink } from 'lucide-react';
+import { Copy, Check, Loader2, ExternalLink, BotMessageSquare } from 'lucide-react';
import { Feedback } from './feedback';
+import { toggleDecimalWidget } from './ask-ai-button';
interface PageActionsProps {
path: string;
@@ -133,6 +134,25 @@ export function PageActions({ path }: PageActionsProps) {
aria-orientation="vertical"
/>
+ {/* Ask AI */}
+ <button
+ type="button"
+ onClick={toggleDecimalWidget}
+ className="inline-flex items-center gap-1.5 px-3 py-2 sm:px-2.5 sm:py-1.5 text-xs font-medium
+ text-fd-muted-foreground hover:text-fd-foreground
+ bg-fd-secondary/50 hover:bg-fd-secondary
+ rounded-md
+ transition-all duration-150 ease-out
+ focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring focus-visible:ring-offset-2 focus-visible:ring-offset-fd-background
+ active:scale-[0.98]
+ touch-manipulation
+ motion-reduce:transition-none motion-reduce:active:scale-100"
+ aria-label="Ask AI"
+ >
+ <BotMessageSquare className="size-3.5" aria-hidden="true" />
+ <span>Ask AI</span>
+ </button>
+
{/* Feedback */}
<Feedback page={path} />
</div>