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
Failed images now become visible for debugging instead of staying invisible at opacity-0. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sushmithamallesh committed
Jan 28, 2026 at 15:36 UTC
3787d901de600b3575c8948c8ef8f5493036b818
1 file changed
+5
-1
docs/components/figure.tsx
+5
-1
@@ -48,6 +48,9 @@ export function Figure({ src, alt, caption, size = 'full', className, width, hei
48
const isConstrained = size !== 'full';
49
const dimensions = defaultDimensions[size];
50
51
+ // Show image on load or error (so broken images are visible for debugging)
52
+ const handleReady = () => setIsLoaded(true);
53
+
54
return (
55
<figure className={cn('my-8', isConstrained && 'flex flex-col items-center', className)}>
56
<Zoom zoomImg={{ src }}>
@@ -58,7 +61,8 @@ export function Figure({ src, alt, caption, size = 'full', className, width, hei
61
height={height || dimensions.height}
62
sizes={sizesAttr[size]}
63
priority={priority}
61
- onLoad={() => setIsLoaded(true)}
64
+ onLoad={handleReady}
65
+ onError={handleReady}
66
className={cn(
67
'rounded-lg border border-fd-border transition-opacity duration-300',
68
isLoaded ? 'opacity-100' : 'opacity-0',