Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
feat(docs): add themed Decimal chat widget and update nav
- Create DecimalWidget client component for Decimal chat integration - Add push-sidebar display mode for better UX - Implement light/dark theme detection with MutationObserver - Use Composio design tokens for consistent theming - Follow Vercel React best practices with proper useEffect cleanup - Update Playground to icon button with orange Play icon - Remove Dashboard button from nav Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sushmithamallesh committed
Feb 5, 2026 at 14:05 UTC
d37a17949240f6e7fa2132d968fa807e698f2954
3 files changed
+76
-14
docs/app/layout.tsx
+2
-7
@@ -1,10 +1,10 @@
1
import { RootProvider } from 'fumadocs-ui/provider/next';
2
import type { Metadata } from 'next';
3
-import Script from 'next/script';
3
import { Analytics } from '@vercel/analytics/next';
4
import './global.css';
5
import { IBM_Plex_Mono } from 'next/font/google';
6
import { PostHogProvider } from '@/components/posthog-provider';
7
+import { DecimalWidget } from '@/components/decimal-widget';
8
9
export const metadata: Metadata = {
10
title: {
@@ -103,12 +103,7 @@ export default function Layout({ children }: LayoutProps<'/'>) {
103
{children}
104
</RootProvider>
105
</PostHogProvider>
106
- <Script
107
- src="https://app.getdecimal.ai/widget/v1/widget.js"
108
- data-widget-id="wgt_Ze0kCx97w7YXIydXpEAbAVWfu7FO6HG1"
109
- data-public-config="eyJhbGciOiJIUzI1NiJ9.eyJ3aWQiOiJ3Z3RfWmUwa0N4OTd3N1lYSXlkWHBFQWJBVldmdTdGTzZIRzEiLCJkb21haW5zIjpbImNvbXBvc2lvLmRldiIsImNvbXBvc2lvLWRlY2ltYWwudmVyY2VsLmFwcCIsImxvY2FsaG9zdDozMDAwIiwiZG9jcy5jb21wb3Npby5kZXYiLCJmdW1hZG9jcy1wc2kudmVyY2VsLmFwcCJdLCJpYXQiOjE3Njk1MDE3NTZ9.j7odPAOmoKSkdkFHQCs7FDpAxHfJuzUOEMb_OuHi81I"
110
- strategy="afterInteractive"
111
- />
106
+ <DecimalWidget />
107
</body>
108
</html>
109
);
docs/components/decimal-widget.tsx
new
+66
@@ -0,0 +1,66 @@
1
+'use client';
2
+
3
+import Script from 'next/script';
4
+import { useEffect, useState } from 'react';
5
+
6
+type DecimalAPI = { theme: (config: Record<string, string>) => void };
7
+
8
+const DARK_THEME = {
9
+ colorScheme: 'dark',
10
+ primaryColor: '#1e1d1c',
11
+ backgroundColor: '#131211',
12
+ textColor: '#FAFAFA',
13
+ textColorSecondary: '#FFFFFF',
14
+ textColorMuted: '#A1A1AA',
15
+ borderColor: '#27272A',
16
+};
17
+
18
+const LIGHT_THEME = {
19
+ colorScheme: 'light',
20
+ primaryColor: '#171414',
21
+ backgroundColor: '#ffffff',
22
+ textColor: '#171414',
23
+ textColorSecondary: '#ffffff',
24
+ textColorMuted: '#5c5858',
25
+ borderColor: '#e5e0df',
26
+};
27
+
28
+export function DecimalWidget() {
29
+ const [scriptLoaded, setScriptLoaded] = useState(false);
30
+
31
+ useEffect(() => {
32
+ if (!scriptLoaded) return;
33
+
34
+ const Decimal = (window as typeof window & { Decimal?: DecimalAPI }).Decimal;
35
+ if (!Decimal) return;
36
+
37
+ const applyTheme = () => {
38
+ const isDark = document.documentElement.classList.contains('dark');
39
+ Decimal.theme(isDark ? DARK_THEME : LIGHT_THEME);
40
+ };
41
+
42
+ applyTheme();
43
+
44
+ const observer = new MutationObserver((mutations) => {
45
+ for (const mutation of mutations) {
46
+ if (mutation.attributeName === 'class') {
47
+ applyTheme();
48
+ }
49
+ }
50
+ });
51
+ observer.observe(document.documentElement, { attributes: true });
52
+
53
+ return () => observer.disconnect();
54
+ }, [scriptLoaded]);
55
+
56
+ return (
57
+ <Script
58
+ src="https://app.getdecimal.ai/widget/v1/widget.js"
59
+ data-widget-id="wgt_Ze0kCx97w7YXIydXpEAbAVWfu7FO6HG1"
60
+ data-public-config="eyJhbGciOiJIUzI1NiJ9.eyJ3aWQiOiJ3Z3RfWmUwa0N4OTd3N1lYSXlkWHBFQWJBVldmdTdGTzZIRzEiLCJkb21haW5zIjpbImNvbXBvc2lvLmRldiIsImNvbXBvc2lvLWRlY2ltYWwudmVyY2VsLmFwcCIsImxvY2FsaG9zdDozMDAwIiwiZG9jcy5jb21wb3Npby5kZXYiLCJmdW1hZG9jcy1wc2kudmVyY2VsLmFwcCJdLCJpYXQiOjE3Njk1MDE3NTZ9.j7odPAOmoKSkdkFHQCs7FDpAxHfJuzUOEMb_OuHi81I"
61
+ data-display-mode="push-sidebar"
62
+ strategy="afterInteractive"
63
+ onLoad={() => setScriptLoaded(true)}
64
+ />
65
+ );
66
+}
docs/lib/layout.shared.tsx
+8
-7
@@ -1,5 +1,6 @@
1
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
2
import Image from 'next/image';
3
+import { Play } from 'lucide-react';
4
5
// Composio Logo Component with light/dark mode switching
6
function ComposioLogo() {
@@ -49,11 +50,6 @@ export function baseOptions(): BaseLayoutProps {
50
url: '/reference',
51
active: 'nested-url',
52
},
52
- {
53
- text: 'Playground',
54
- url: 'https://platform.composio.dev/auth?next_page=%2Ftool-router&utm_source=docs&utm_medium=navbar&utm_campaign=tool_router',
55
- external: true,
56
- },
53
{
54
text: 'Examples',
55
url: '/examples',
@@ -74,8 +70,13 @@ export function baseOptions(): BaseLayoutProps {
70
},
71
{
72
type: 'button',
77
- text: 'Dashboard',
78
- url: 'https://platform.composio.dev',
73
+ text: (
74
+ <span className="inline-flex items-center gap-1.5">
75
+ <Play className="size-4" style={{ color: 'var(--composio-orange)' }} />
76
+ Playground
77
+ </span>
78
+ ),
79
+ url: 'https://platform.composio.dev/auth?next_page=%2Ftool-router&utm_source=docs&utm_medium=navbar&utm_campaign=tool_router',
80
external: true,
81
secondary: true,
82
},