Skip to content

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

fix: Add onError handler so failed images remain visible

Sushmithamallesh3787d901de60
diff --git a/docs/components/figure.tsx b/docs/components/figure.tsx
index 359d5e039..b16f3dee2 100644
--- a/docs/components/figure.tsx
+++ b/docs/components/figure.tsx
@@ -48,6 +48,9 @@ export function Figure({ src, alt, caption, size = 'full', className, width, hei
const isConstrained = size !== 'full';
const dimensions = defaultDimensions[size];
+ // Show image on load or error (so broken images are visible for debugging)
+ const handleReady = () => setIsLoaded(true);
+
return (
<figure className={cn('my-8', isConstrained && 'flex flex-col items-center', className)}>
<Zoom zoomImg={{ src }}>
@@ -58,7 +61,8 @@ export function Figure({ src, alt, caption, size = 'full', className, width, hei
height={height || dimensions.height}
sizes={sizesAttr[size]}
priority={priority}
- onLoad={() => setIsLoaded(true)}
+ onLoad={handleReady}
+ onError={handleReady}
className={cn(
'rounded-lg border border-fd-border transition-opacity duration-300',
isLoaded ? 'opacity-100' : 'opacity-0',