@devries-cameron20 / composio Mirror · read-only / commits / b0b7fac9d
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 21, 19:45 UTC

docs: featured examples gallery + fix title selection (#3682)

## What Reworks the `/examples` index into a Modal-style **featured gallery**, styled to the Composio brand (pulled from `~/composio/landing`): flat editorial cards, sharp corners, mono uppercase category tags in accent colors, the signature brand offset-shadow on hover, and real toolkit logos on white chips. | Light | Dark | |---|---| | Big `font-sans` hero, filter pills with live counts, responsive card grid | Same, brand-consistent | ### Highlights - **`<ExamplesGallery>`** — hero, category filter pills (Featured / General agents / Background agents / Coding agents) with live counts, responsive 1–3 col grid, staggered load-in. - **Data-driven from frontmatter.** Card title/description come from each page's own `title`/`description`. Presentation metadata lives in a new optional `gallery` block in the frontmatter schema: ```yaml gallery: categories: [General agents, Background agents] logos: [slack] featured: true order: 0 ``` Examples can belong to **multiple category lanes** (the Pi bot is both General + Background). - The index route renders the gallery; nested example pages keep the standard docs renderer. ### Drive-by fix `PageActions` lifts a **full-width** row over the page title (`-mt-12`) to place the "Copy page" button beside it. That invisible overlay sat on top of the title and blocked selecting/copying it. Fixed by making the overlay `pointer-events-none` and re-enabling them only on the button wrapper. Affects every docs page. ## Testing - `bun run types:check` passes. - Verified in light + dark: titles/descriptions match page frontmatter, multi-tag cards, filter counts, logo visibility (GitHub on white chips), title now selectable, Copy button still clickable. ## Notes - Category lanes are a fixed enum in two spots (`source.config.ts` enum + `CATEGORY_STYLES` color map in `examples-gallery.tsx`) — adding a new lane is a two-place edit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Rahul Tarak committed Jun 26, 2026 at 01:24 UTC b0b7fac9d9ca0812a05fff2d6ed66fe05a2c3646
7 files changed +303 -3
docs/app/(home)/examples/[[...slug]]/page.tsx
+33 -1
@@ -1,6 +1,38 @@
1 import { examplesSource } from '@/lib/source';
2 import { createDocsPage, createGenerateStaticParams, createGenerateMetadata } from '@/lib/create-docs-page';
3 +import { ExamplesGallery, type GalleryItem } from '@/components/examples-gallery';
4 +
5 +const DocsPage = createDocsPage(examplesSource);
6 +
7 +function getGalleryItems(): GalleryItem[] {
8 + return examplesSource
9 + .getPages()
10 + .flatMap((page): GalleryItem[] => {
11 + const gallery = page.data.gallery;
12 + if (!gallery) return []; // skip the index and any page without gallery meta
13 + return [
14 + {
15 + title: page.data.title,
16 + description: page.data.description ?? '',
17 + href: page.url,
18 + categories: gallery.categories,
19 + logos: gallery.logos,
20 + featured: gallery.featured,
21 + order: gallery.order,
22 + },
23 + ];
24 + });
25 +}
26 +
27 +export default async function Page({ params }: { params: Promise<{ slug?: string[] }> }) {
28 + const { slug } = await params;
29 + // The examples index renders a custom featured gallery; nested slugs use the
30 + // standard docs page renderer.
31 + if (!slug || slug.length === 0) {
32 + return <ExamplesGallery items={getGalleryItems()} />;
33 + }
34 + return DocsPage({ params: Promise.resolve({ slug }) });
35 +}
36
4 -export default createDocsPage(examplesSource);
37 export const generateStaticParams = createGenerateStaticParams(examplesSource);
38 export const generateMetadata = createGenerateMetadata(examplesSource, 'examples');
docs/components/examples-gallery.tsx new
+234
@@ -0,0 +1,234 @@
1 +'use client';
2 +
3 +import Link from 'next/link';
4 +import { useMemo, useState } from 'react';
5 +import { ArrowUpRight } from 'lucide-react';
6 +
7 +/* ------------------------------------------------------------------ *
8 + * Items come from each example's frontmatter (read in the route from the
9 + * examples source). Title + description are the page's own; the `gallery`
10 + * block in frontmatter supplies the category lane, toolkit logos, and
11 + * featured flag. No per-example config lives in this component.
12 + * ------------------------------------------------------------------ */
13 +
14 +type Category = 'General agents' | 'Background agents' | 'Coding agents';
15 +
16 +/** A resolved example, ready to render. Built in the route from frontmatter. */
17 +export interface GalleryItem {
18 + title: string;
19 + description: string;
20 + href: string;
21 + categories: Category[];
22 + logos: string[];
23 + featured?: boolean;
24 + order?: number;
25 +}
26 +
27 +/* ------------------------------------------------------------------ *
28 + * Category styling — flat editorial tags in the brand accent palette.
29 + * Full class strings are written out so Tailwind's JIT keeps them.
30 + * ------------------------------------------------------------------ */
31 +
32 +interface CatStyle {
33 + tag: string; // mono pill on the card
34 + dot: string; // filter-pill dot
35 + bar: string; // top accent bar on hover
36 +}
37 +
38 +const CATEGORY_STYLES: Record<Category, CatStyle> = {
39 + 'General agents': {
40 + tag: 'text-blue-500 border-blue-500/25 bg-blue-500/[0.06] dark:text-blue-400 dark:border-blue-400/25',
41 + dot: 'bg-blue-500 dark:bg-blue-400',
42 + bar: 'bg-blue-500 dark:bg-blue-400',
43 + },
44 + 'Background agents': {
45 + tag: 'text-violet-500 border-violet-500/25 bg-violet-500/[0.06] dark:text-violet-400 dark:border-violet-400/25',
46 + dot: 'bg-violet-500 dark:bg-violet-400',
47 + bar: 'bg-violet-500 dark:bg-violet-400',
48 + },
49 + 'Coding agents': {
50 + tag: 'text-emerald-600 border-emerald-500/25 bg-emerald-500/[0.06] dark:text-emerald-400 dark:border-emerald-400/25',
51 + dot: 'bg-emerald-600 dark:bg-emerald-400',
52 + bar: 'bg-emerald-600 dark:bg-emerald-400',
53 + },
54 +};
55 +
56 +const CATEGORIES: ('Featured' | Category)[] = [
57 + 'Featured',
58 + 'General agents',
59 + 'Background agents',
60 + 'Coding agents',
61 +];
62 +
63 +function logoUrl(name: string) {
64 + return `https://logos.composio.dev/api/${name}`;
65 +}
66 +
67 +/* ------------------------------------------------------------------ *
68 + * Card
69 + * ------------------------------------------------------------------ */
70 +
71 +function ExampleCard({ ex, index }: { ex: GalleryItem; index: number }) {
72 + // The first category drives the hover accent bar.
73 + const primary = CATEGORY_STYLES[ex.categories[0] ?? 'General agents'];
74 + return (
75 + <Link
76 + href={ex.href}
77 + style={{ animationDelay: `${Math.min(index, 8) * 55}ms` }}
78 + className="exg-card group relative flex flex-col border border-fd-border bg-fd-card [text-decoration:none] transition-[transform,box-shadow,background-color] duration-200 ease-out hover:-translate-x-[3px] hover:-translate-y-[3px] hover:bg-fd-card hover:shadow-[6px_6px_0_0_color-mix(in_srgb,var(--composio-brand)_24%,transparent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--composio-brand)] focus-visible:ring-offset-2 focus-visible:ring-offset-fd-background"
79 + >
80 + {/* top accent bar — grows in on hover */}
81 + <span
82 + className={`absolute left-0 top-0 h-[2px] w-0 transition-[width] duration-300 ease-out group-hover:w-full ${primary.bar}`}
83 + />
84 +
85 + <div className="flex items-start justify-between gap-4 p-5 pb-0">
86 + <div className="flex flex-wrap items-center gap-1.5">
87 + {ex.categories.map((cat) => (
88 + <span
89 + key={cat}
90 + className={`inline-flex items-center border px-2 py-1 font-mono text-[10px] font-medium uppercase tracking-wide ${CATEGORY_STYLES[cat].tag}`}
91 + >
92 + {cat}
93 + </span>
94 + ))}
95 + </div>
96 + {ex.logos.length > 0 && (
97 + <div className="flex shrink-0 items-center -space-x-1.5">
98 + {ex.logos.map((logo) => (
99 + // eslint-disable-next-line @next/next/no-img-element
100 + <img
101 + key={logo}
102 + alt={logo}
103 + src={logoUrl(logo)}
104 + // White tile in both themes (matches the brand's logo chips) so
105 + // monochrome marks like GitHub stay visible on dark cards.
106 + className="h-7 w-7 rounded-[5px] border border-black/10 bg-white object-contain p-1 ring-2 ring-fd-card"
107 + loading="lazy"
108 + />
109 + ))}
110 + </div>
111 + )}
112 + </div>
113 +
114 + <div className="flex flex-1 flex-col gap-2 p-5 pt-4">
115 + <h3 className="font-sans text-lg font-medium leading-snug text-fd-foreground [text-wrap:balance]">
116 + {ex.title}
117 + </h3>
118 + <p className="line-clamp-3 text-sm leading-relaxed text-fd-muted-foreground">
119 + {ex.description}
120 + </p>
121 + </div>
122 +
123 + <div className="mt-auto flex items-center gap-1.5 border-t border-fd-border px-5 py-3 font-mono text-[11px] uppercase tracking-wide text-fd-muted-foreground transition-colors group-hover:text-[var(--composio-brand)]">
124 + Read guide
125 + <ArrowUpRight className="h-3.5 w-3.5 transition-transform duration-200 group-hover:translate-x-0.5 group-hover:-translate-y-0.5" />
126 + </div>
127 + </Link>
128 + );
129 +}
130 +
131 +/* ------------------------------------------------------------------ *
132 + * Gallery
133 + * ------------------------------------------------------------------ */
134 +
135 +export function ExamplesGallery({ items }: { items: GalleryItem[] }) {
136 + const [active, setActive] = useState<'Featured' | Category>('Featured');
137 +
138 + const resolved = useMemo<GalleryItem[]>(
139 + () => [...items].sort((a, b) => (a.order ?? 99) - (b.order ?? 99)),
140 + [items],
141 + );
142 +
143 + const visible = useMemo(() => {
144 + if (active === 'Featured') return resolved.filter((e) => e.featured);
145 + return resolved.filter((e) => e.categories.includes(active));
146 + }, [active, resolved]);
147 +
148 + const countFor = (label: 'Featured' | Category) =>
149 + label === 'Featured'
150 + ? resolved.filter((e) => e.featured).length
151 + : resolved.filter((e) => e.categories.includes(label)).length;
152 +
153 + return (
154 + <div className="exg w-full px-5 py-12 sm:px-8 lg:px-12 lg:py-16">
155 + {/* Hero */}
156 + <header className="mb-10 max-w-3xl">
157 + <p className="mb-4 font-mono text-[11px] font-medium uppercase tracking-[0.22em] text-fd-muted-foreground">
158 + Examples
159 + </p>
160 + <h1 className="font-sans text-4xl font-normal leading-[1.05] tracking-tight text-fd-foreground sm:text-5xl lg:text-6xl">
161 + Featured examples
162 + </h1>
163 + <p className="mt-5 max-w-2xl text-base leading-relaxed text-fd-muted-foreground sm:text-lg">
164 + End-to-end builds that wire Composio into working agents. Each one is a
165 + complete project you can read top to bottom and run.
166 + </p>
167 + </header>
168 +
169 + {/* Filter pills */}
170 + <div className="mb-9 flex flex-wrap gap-2 border-b border-fd-border pb-6">
171 + {CATEGORIES.map((label) => {
172 + const isActive = active === label;
173 + const count = countFor(label);
174 + const dot = label === 'Featured' ? undefined : CATEGORY_STYLES[label].dot;
175 + return (
176 + <button
177 + key={label}
178 + type="button"
179 + onClick={() => setActive(label)}
180 + aria-pressed={isActive}
181 + className={`inline-flex items-center gap-2 border px-3.5 py-1.5 font-mono text-xs font-medium uppercase tracking-wide transition-colors duration-150 ${
182 + isActive
183 + ? 'border-fd-foreground bg-fd-foreground text-fd-background'
184 + : 'border-fd-border bg-fd-card text-fd-muted-foreground hover:border-fd-foreground/30 hover:text-fd-foreground'
185 + }`}
186 + >
187 + {label === 'Featured' ? (
188 + <span
189 + className={`h-2 w-2 ${isActive ? 'bg-fd-background' : 'bg-[var(--composio-brand)]'}`}
190 + />
191 + ) : (
192 + <span className={`h-2 w-2 rounded-full ${dot}`} />
193 + )}
194 + {label}
195 + <span
196 + className={`tabular-nums ${isActive ? 'text-fd-background/55' : 'text-fd-muted-foreground/50'}`}
197 + >
198 + {count}
199 + </span>
200 + </button>
201 + );
202 + })}
203 + </div>
204 +
205 + {/* Grid */}
206 + {visible.length > 0 ? (
207 + <div className="grid grid-cols-1 gap-5 sm:grid-cols-2 xl:grid-cols-3">
208 + {visible.map((ex, i) => (
209 + <ExampleCard key={ex.href} ex={ex} index={i} />
210 + ))}
211 + </div>
212 + ) : (
213 + <div className="border border-dashed border-fd-border px-6 py-16 text-center font-mono text-sm text-fd-muted-foreground">
214 + More examples in this category are on the way.
215 + </div>
216 + )}
217 +
218 + <style>{`
219 + .exg-card {
220 + opacity: 0;
221 + animation: exg-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
222 + }
223 + @keyframes exg-rise {
224 + from { opacity: 0; transform: translateY(12px); }
225 + to { opacity: 1; transform: translateY(0); }
226 + }
227 + @media (prefers-reduced-motion: reduce) {
228 + .exg-card { animation: none; opacity: 1; }
229 + .exg-card * { transition: none !important; }
230 + }
231 + `}</style>
232 + </div>
233 + );
234 +}
docs/components/page-actions.tsx
+2 -2
@@ -77,8 +77,8 @@ export function PageActions({ path, variant = 'overlap-title' }: PageActionsProp
77 }, [path]);
78
79 return (
80 - <div className={variant === 'overlap-title' ? 'not-prose -mt-12 mb-2 flex justify-end' : 'not-prose inline-block'}>
81 - <div ref={wrapperRef} className="relative">
80 + <div className={variant === 'overlap-title' ? 'not-prose -mt-12 mb-2 flex justify-end pointer-events-none' : 'not-prose inline-block'}>
81 + <div ref={wrapperRef} className="relative pointer-events-auto">
82 <button
83 type="button"
84 onClick={() => setOpen((v) => !v)}
docs/content/examples/general-agent-with-pi.mdx
+5
@@ -3,6 +3,11 @@ title: Build a Slack bot that can do work with you and your team
3 description: Build a general-purpose agent with Pi and Composio, then drop it into Slack so a whole team can use it. Triggers, per-user sessions, a shared workspace connection, redirected auth links, and raw API access.
4 keywords: [general agent, pi, slack bot, triggers, sessions, shared connections, auth links, proxy, slackbot toolkit, webhook]
5 full: true
6 +gallery:
7 + categories: [General agents, Background agents]
8 + logos: [slack]
9 + featured: true
10 + order: 0
11 ---
12
13 The agent is the easy part. [Pi](https://github.com/earendil-works/pi/tree/main/packages/coding-agent) does the reasoning; Composio gives it 1000+ apps to act on. In three lines you have an agent that can open a PR, check a calendar, or search a Notion workspace for one user.
docs/content/examples/local-sandbox-pr-reviewer.mdx
+5
@@ -3,6 +3,11 @@ title: Review pull requests in a sandbox you own
3 description: Composio usually runs your tools for you. A local sandbox is for when you need to run them yourself, on your filesystem, in your shell, inside your security boundary. Build a GitHub PR reviewer that runs checks in a sandbox you own and posts one grounded comment.
4 keywords: [local sandbox, sandbox, github, pull request review, tool router, e2b, code execution, run_composio_tool, security boundary]
5 full: true
6 +gallery:
7 + categories: [Coding agents]
8 + logos: [github]
9 + featured: true
10 + order: 2
11 ---
12
13 Composio usually runs your tools for you. A **local sandbox** is for the times you need to run them yourself: your filesystem, your shell, your security boundary. You still get [managed auth](/docs/authentication) and 1000+ apps; you just keep the code execution.
docs/content/examples/standup-slackbot.mdx
+5
@@ -3,6 +3,11 @@ title: Daily standup bot
3 description: A Slack bot that writes each teammate's standup from their own connected tools. Build your own white-labelled bot, give it native Slack interactions with Composio's proxy, and let a tool-router agent write the draft.
4 keywords: [standup bot, slack bot, slackbot toolkit, white labeling, custom auth config, tool router, sessions, connected accounts, proxy, auth links, vercel, cron, interactivity]
5 full: true
6 +gallery:
7 + categories: [Background agents]
8 + logos: [slack, github, linear]
9 + featured: true
10 + order: 1
11 ---
12
13 Standup is a crucial part of running an effective engineering team, and also oh so tedious: every morning, everyone digs back through what they did and writes it up. It's worse for teams spread across timezones, where there's no shared standup to anchor the day, so it's easy to just forget.
docs/source.config.ts
+19
@@ -38,6 +38,25 @@ const docsSchema = frontmatterSchema.extend({
38 }),
39 )
40 .optional(),
41 + /** Presentation metadata for the /examples featured gallery. The card's
42 + * title and description come from `title`/`description`; this controls the
43 + * category lane, toolkit logos, and whether it surfaces in "Featured". */
44 + gallery: z
45 + .object({
46 + /** Category lanes this example belongs to (can be more than one). */
47 + categories: z
48 + .array(
49 + z.enum(['General agents', 'Background agents', 'Coding agents']),
50 + )
51 + .min(1),
52 + /** Toolkit logo slugs (logos.composio.dev/api/<slug>) shown on the card. */
53 + logos: z.array(z.string()).default([]),
54 + /** Surface in the default "Featured" view. */
55 + featured: z.boolean().optional(),
56 + /** Sort order within the grid (lower first). */
57 + order: z.number().optional(),
58 + })
59 + .optional(),
60 });
61
62 export const docs = defineDocs({