@devries-cameron20 / composio Mirror · read-only / commits / ec6e12335
Fork 0

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

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 09:30 UTC

docs: make accordions linkable with auto-generated IDs

Wrap the fumadocs Accordion component to auto-generate an id from the title prop, so every accordion gets a copy-link button and can be deep-linked via URL hash. The link icon is hidden by default and shown on hover. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Sushmithamallesh committed Feb 11, 2026 at 20:15 UTC ec6e12335e7ccfe30e7299c412abee1c6ef0d024
3 files changed +20 -2
docs/app/global.css
+9
@@ -521,6 +521,15 @@ p.text-fd-muted-foreground.not-prose:has(> code.text-xs) {
521 --color-fd-primary: var(--composio-orange);
522 }
523
524 +/* Accordion copy-link button: hidden by default, visible on hover */
525 +[data-accordion-value] button[aria-label="Copy Link"] {
526 + opacity: 0;
527 + transition: opacity 150ms;
528 +}
529 +[data-accordion-value]:hover button[aria-label="Copy Link"] {
530 + opacity: 1;
531 +}
532 +
533 @layer base {
534 * {
535 @apply border-border outline-ring/50;
docs/components/toolkits/faq-section.tsx
+1 -1
@@ -23,7 +23,7 @@ export function FaqSection({ faq }: FaqSectionProps) {
23 </h2>
24 <Accordions type="single">
25 {faq.map((item) => (
26 - <Accordion key={item.question} title={item.question}>
26 + <Accordion key={item.question} title={item.question} id={item.question.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '')}>
27 <div
28 className="prose prose-sm prose-fd max-w-none text-fd-muted-foreground"
29 dangerouslySetInnerHTML={{ __html: item.answer }}
docs/mdx-components.tsx
+10 -1
@@ -3,7 +3,16 @@ import type { MDXComponents } from 'mdx/types';
3 import { Heading } from '@/components/heading';
4 import { YouTube } from '@/components/youtube';
5 import { Tabs, Tab, TabsList, TabsTrigger, TabsContent } from 'fumadocs-ui/components/tabs';
6 -import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';
6 +import { Accordion as BaseAccordion, Accordions } from 'fumadocs-ui/components/accordion';
7 +import type { ComponentProps } from 'react';
8 +
9 +function slugify(text: string): string {
10 + return text.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
11 +}
12 +
13 +function Accordion({ id, title, ...props }: ComponentProps<typeof BaseAccordion>) {
14 + return <BaseAccordion id={id ?? (typeof title === 'string' ? slugify(title) : undefined)} title={title} {...props} />;
15 +}
16 import { Callout } from 'fumadocs-ui/components/callout';
17 import { Step, Steps } from 'fumadocs-ui/components/steps';
18 import { Card, Cards } from 'fumadocs-ui/components/card';