Files
composiohq__composio/docs/mdx-components.tsx
T
Malay Vasa d84557ca21 docs: rework welcome page with v2 hero and homepage sections (#3464)
## Summary

Reworks the docs welcome page (`/docs`) into a two-column hero with an
animated agent chat mock + tool overlay, plus four restructured homepage
sections.

### Hero (`DocsHeroV2`)
- Left: headline (`Start building with Composio.`), short sub,
brand-blue chip column (Quickstart, API reference, Toolkits).
- Right (lg+ only): mock chat panel with the v1 hero's per-agent skin
(`Claude Cowork` / `ChatGPT Codex` / `Your AI Agent`), step-by-step
timeline-driven animation (user prompt → thinking dots → tool-trail
items → assistant response), and a floating "active tool" card layered
over the chat's left edge.
- L-shape SVG connector between chat and overlay: muted grey resting
state + brand-blue glow + bright line that re-draw via `pathLength` on
every tool change.
- Mock chat hidden below lg.

### Homepage sections
- **`HomeFeatures`** — `Everything you need to ship production agents.`
2×2 grid with bespoke visuals per pillar: 8×2 toolkit grid with `+1K`
cell, sessions panel (`USER_ID` + connected apps), triggers feed (`LIVE`
indicator + recent events), and a workbench mock with animated 4×2 CPU
lights. `auto-rows-fr` on `sm:` so cards equalize on tablet/desktop but
breathe on mobile.
- **`HomeSurfaces`** — `Three ways to use Composio.` bento: Developer
card spans full width (`md:col-span-3`) and shows 8 provider logos
(Anthropic, OpenAI, Vercel AI, Google, LangChain, CrewAI, LlamaIndex,
Mastra). Row 2: For You (with Claude / Codex / Cursor / Windsurf /
OpenClaw client logos), CLI (with `curl ... | bash` install snippet and
functional copy button), Agents.
- **`HomeResources`** — `Reach for the rest.` six-card footer row with
Quickstart, API reference, Cookbooks, Changelog, Toolkits,
Troubleshooting.

### Other
- Ports the landing-page hero into `components/landing-hero/` (kept
under the original `DocsHero` for easy revert; commented out, V2 wired
in).
- Theme-aware `--hero-*` CSS vars for chat-skin colors so the chat reads
in both light and dark.
- Removes the old `Works with your stack` provider grid (the providers
now live inside the Developer surface card).

## Test plan
- [ ] Verify hero animation cycles through 3 examples on desktop
- [ ] Verify L-shape connector pulses in brand blue on every tool change
- [ ] Verify chat mock is hidden on mobile and left column reads on its
own
- [ ] Verify dark mode (chat skins, connector, card surfaces, code
blocks)
- [ ] Verify CLI install copy button copies and toggles the icon to ✓
- [ ] Verify all chip / card hrefs resolve

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 22:06:35 -07:00

138 lines
4.0 KiB
TypeScript

import defaultMdxComponents from 'fumadocs-ui/mdx';
import type { MDXComponents } from 'mdx/types';
import type { ComponentProps } from 'react';
import { Accordion as BaseAccordion, Accordions } from 'fumadocs-ui/components/accordion';
import { Tabs, Tab, TabsList, TabsTrigger, TabsContent } from 'fumadocs-ui/components/tabs';
import { Callout } from '@/components/callout';
import { Step, Steps } from 'fumadocs-ui/components/steps';
import { Card, Cards } from 'fumadocs-ui/components/card';
import { ImageZoom } from 'fumadocs-ui/components/image-zoom';
import { Heading } from '@/components/heading';
import { YouTube } from '@/components/youtube';
import { ProviderCard, ProviderGrid } from '@/components/provider-card';
import { FrameworkSelector, QuickstartFlow, FrameworkOption } from '@/components/quickstart';
import { IntegrationTabs, IntegrationContent } from '@/components/quickstart/integration-tabs';
import { ToolTypeFlow, ToolTypeOption } from '@/components/tool-type-selector';
import { ConnectFlow, ConnectClientOption } from '@/components/connect-flow';
import { Figure } from '@/components/figure';
import { StepTitle } from '@/components/step-title';
import { Video } from '@/components/video';
import { CapabilityCard, CapabilityList } from '@/components/capability-card';
import { TemplateCard, TemplateGrid } from '@/components/template-card';
import { ToolkitsLanding } from '@/components/toolkits/toolkits-landing';
import { ManagedAuthList } from '@/components/toolkits/managed-auth-list';
import { Mermaid } from '@/components/mermaid';
import { AIToolsBanner } from '@/components/ai-tools-banner';
import { DocsHero } from '@/components/docs-hero';
import { HomeFeatures } from '@/components/home-features';
import { HomeSurfaces } from '@/components/home-surfaces';
import { HomeResources } from '@/components/home-resources';
import { Glossary, GlossaryTerm } from '@/components/glossary';
import { ApiBaseUrl } from '@/components/api-base-url';
import { ApiEndpointsTable } from '@/components/api-endpoints-table';
import { ClaudeMockUI } from '@/components/claude-mock-ui';
import {
ShieldCheck,
Route as RouteIcon,
Key,
Search,
Wrench,
Database,
Zap,
Rocket,
Code,
Blocks,
Plug,
Play,
Terminal,
Palette,
BookOpen,
Monitor,
MessageCircle,
LayoutDashboard,
} from 'lucide-react';
function slugify(text: string): string {
return text.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
}
export function Accordion({ id, title, ...props }: ComponentProps<typeof BaseAccordion>) {
return <BaseAccordion id={id ?? (typeof title === 'string' ? slugify(title) : undefined)} title={title} {...props} />;
}
export { Accordions };
export function getMDXComponents(components?: MDXComponents): MDXComponents {
return {
...defaultMdxComponents,
h2: (props) => <Heading as="h2" {...props} />,
h3: (props) => <Heading as="h3" {...props} />,
h4: (props) => <Heading as="h4" {...props} />,
img: (props) => <ImageZoom {...(props as any)} />,
YouTube,
Tabs,
Tab,
TabsList,
TabsTrigger,
TabsContent,
Accordion,
Accordions,
Callout,
Step,
Steps,
Card,
Cards,
ProviderCard,
ProviderGrid,
FrameworkSelector,
QuickstartFlow,
FrameworkOption,
IntegrationTabs,
IntegrationContent,
ToolTypeFlow,
ToolTypeOption,
ConnectFlow,
ConnectClientOption,
Figure,
Video,
CapabilityCard,
CapabilityList,
TemplateCard,
TemplateGrid,
ToolkitsLanding,
ManagedAuthList,
Mermaid,
AIToolsBanner,
DocsHero,
HomeFeatures,
HomeSurfaces,
HomeResources,
StepTitle,
Glossary,
GlossaryTerm,
ApiBaseUrl,
ApiEndpointsTable,
ClaudeMockUI,
// Lucide icons
ShieldCheck,
RouteIcon,
Key,
Search,
Wrench,
Database,
Zap,
Rocket,
Code,
Blocks,
Plug,
Play,
Terminal,
Palette,
BookOpen,
Monitor,
MessageCircle,
LayoutDashboard,
...components,
};
}