CEy6_CGkQ ZHm4Tpi%
z_XiJ?37})HKU1uWw@iKQAk6IR=#E`>3yjw|43 ZKBrd80t9S8lSxJ_5ThO{OdH4s(A;o9%0H
zM9fOn{=gCV^9E?)4SW`BjA8)V2vtn@Y-jf5e&?4|wx%U_j(w18rnS(3789k-C*zQy
zL7}N*)k1DB6GO|*BrC%WZ{Wm6EI32ZV|x`iB6yx%xhMjs&qoHsL?+*B^nQq|-i-5x
zk_#Cr6tkEEP7N{R@5+62^K$rqC7gRalYIlm?`;kvY$KK&X5$Ibq)-kGGp7)u@)S{t
zDMAj9hhZ3VW>Vx) ) so it stays valid phrasing content:
- // markdown wraps a standalone image in a , and a block-level fallback
- // there would be invalid HTML and trigger a hydration error.
-
+
- {message}
+
+ {message}
+
);
}
diff --git a/website-next/src/design-system/Image.stories.tsx b/website-next/src/design-system/Image.stories.tsx
index 121dac52989..fa364c8b2d8 100644
--- a/website-next/src/design-system/Image.stories.tsx
+++ b/website-next/src/design-system/Image.stories.tsx
@@ -36,7 +36,8 @@ export const Tall: Story = {
/**
* When the source fails to load, the image swaps in the same broken-link
- * placeholder used for unavailable videos.
+ * placeholder used for unavailable videos, sized by the image's intrinsic
+ * aspect ratio.
*/
export const Broken: Story = {
args: {
@@ -46,3 +47,41 @@ export const Broken: Story = {
height: 360,
},
};
+
+/**
+ * Inside a card (e.g. a blog teaser), the placeholder adopts the image's own
+ * layout classes and fills the card's media frame edge to edge.
+ */
+export const BrokenInCard: Story = {
+ args: {
+ src: "https://example.invalid/missing.png",
+ alt: "An image that fails to load",
+ width: 640,
+ height: 360,
+ className: "h-full w-full object-cover",
+ },
+ decorators: [
+ (Story) => (
+ r}!#iHnL@bwMc*p%4zGyy9^MJhpYl
z*K8Fl-&a(@#6Z8;_+sFI@7#?*r=X|QUn4xFQh{sCg%s^jUYEoZOMX?ov4Ml8^?TU#
zZP-p^M5(HyiKN(JqU8$OrM~&zUs|l(uwundR#bO_d7K$70S`IGfjlP4W;2Qn&ob(>
z-|(AMf19)|@MBbCWaabWR{h{hHur3!Q4#+O1#|-IeZux!Ff|SOZFD%TG+f3iA^Nh{
zdqZUfHy^93kK=yWYY5~JKd8;thK^Dy|5?4rgxfOzo8O&z4gz&B8+dTjvmgCNA+anl
zZ5lM$eV>^pv(50*Gn{8ZO~S~-rZ|pr7}Ac*T;3QT^$-e$Z;yoCZrT2u_;)pERW#wl
z-(jBUFRHl0kVWBh?2&$(kXQ~jhL^b#X@0v3_vc0e6-JasoDP?bEUTE)7)}_G{9q(v
zW#u5OV
VJLmh9V=iAW5MN?xIR>^^pV$RVgv7
zN-3S_d`^WY84;w9Zq;isMdA%TrJpKGEh0<{65WA?!U9T0e8p}2+4@`86mh@*g!~Y~
zA%p+qpvmO8L~UW3(cMEvvsaEjsNZyj
?aJ|Bu_|z*@fu`ie>aC*^7qh>ikHn;Z-shEOi2F$o@!$!>0|YT9?_E44
zpVo!EC0|~{L3M~$$$b@@Ie2-Bvo1w$+K}&ZUH;z_(mb>r$*uY1NylPaIP21S{Sop#
zBN^Pmk2D+vQOV?JVGY86Z)B27?G9UIX?7CY4AJCdARn{SG80SdRhU&tqA`(>My~b%
zLPLyM^$~55g?sp3DG3jz9fpf*+6bcd$N}q_b+&6*bJ6w3D6FShHt2mj$FNJRSaAjT
z&h|yGB`8D@F}Ile$gs~2XDZO
You might also like
diff --git a/website-next/src/design-system/BrokenMedia.tsx b/website-next/src/design-system/BrokenMedia.tsx
index e50a2222642..8472d5b3414 100644
--- a/website-next/src/design-system/BrokenMedia.tsx
+++ b/website-next/src/design-system/BrokenMedia.tsx
@@ -1,21 +1,21 @@
-// TODO: Create a better illustration
+import type { CSSProperties } from "react";
type BrokenMediaProps = {
- /** Short reason shown under the icon, e.g. "This image couldn't be loaded." */
message: string;
+ className?: string;
+ style?: CSSProperties;
};
-/**
- * Placeholder shown when a media source (video, image) can't be resolved or
- * loaded: a broken-link illustration with a short message, sized like a 16:9
- * media frame.
- */
-export function BrokenMedia({ message }: BrokenMediaProps) {
+// TODO: Create a better illustration
+export function BrokenMedia({ message, className, style }: BrokenMediaProps) {
return (
- // Rendered as s (not