Skip to main content
Glama
preview.tsx1.4 kB
import type { Preview, StoryContext } from '@storybook/react'; import { useEffect } from 'react'; import '../tailwind.css'; const ThemeProvider = ({ children, theme, }: { children: React.ReactNode; theme: string; }) => { useEffect(() => { // Apply theme to document root document.documentElement.setAttribute('data-theme', theme); }, [theme]); return <>{children}</>; }; const preview: Preview = { decorators: [ (Story, context: StoryContext) => { const theme = context.globals.theme || 'dark'; const isDark = theme === 'dark'; return ( <ThemeProvider theme={theme}> <div className={`min-h-screen bg-background p-4 text-text`}> <Story /> </div> </ThemeProvider> ); }, ], globalTypes: { theme: { description: 'Global theme for components', defaultValue: 'dark', toolbar: { title: 'Theme', icon: 'circlehollow', items: [ { value: 'light', icon: 'sun', title: 'Light' }, { value: 'dark', icon: 'moon', title: 'Dark' }, ], dynamicTitle: true, }, }, }, parameters: { controls: { matchers: { color: /(background|color)$/i, date: /Date$/i, }, }, a11y: { context: 'body', config: {}, options: {}, }, }, }; export default preview;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aymericzip/intlayer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server