🎥 Make videos programmatically with React
Elements: Calibrate social safe zones from app captures
Igor Samokhovets1ba3e1d6a14a
diff --git a/packages/docs/elements/overlays/social-safe-zones/index.mdx b/packages/docs/elements/overlays/social-safe-zones/index.mdxindex aab01699ff..2971345ed4 100644--- a/packages/docs/elements/overlays/social-safe-zones/index.mdx+++ b/packages/docs/elements/overlays/social-safe-zones/index.mdx@@ -1,6 +1,6 @@---title: Social Safe Zones-description: Source-backed safe-area guides for TikTok, Instagram Reels, and YouTube vertical video.+description: Capture-calibrated safe-area guides for TikTok and Instagram Reels.image: https://remotion.media/elements/overlays-social-safe-zones-preview.png---@@ -13,6 +13,6 @@ import {elementDefinitions} from '@site/src/components/Elements/element-definiti## Accuracy-These 9:16 presets use official ad guidance for [TikTok In-Feed Ads](https://ads.tiktok.com/help/article/tiktok-auction-in-feed-ads), [Instagram Reels Ads](https://www.facebook.com/business/ads-guide/update/video/instagram-reels), and [YouTube vertical ads](https://support.google.com/google-ads/answer/9128498).+The presets were measured at 9:16 from representative iOS captures of full-green videos in TikTok and Instagram Reels. The interface references use the positions and footprints from those captures instead of estimated placements or advertising templates. The guide scales to other composition dimensions so it remains visible in previews of any aspect ratio.-Live interfaces can vary by device, app version, locale, caption length, and placement. The interface shapes are illustrative; the safe-area geometry follows the linked guidance. The guide is visible in Remotion Studio and omitted from rendered output.+Live interfaces can vary by device, app version, locale, account state, caption length, and placement. Treat the clear region as a capture-calibrated reference, not a guarantee from either platform. The captured geometry is exact at 9:16 and scaled at other aspect ratios. The guide is visible in Remotion Studio and omitted from rendered output.diff --git a/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsx b/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsxindex 9540768c1d..e6fb461090 100644--- a/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsx+++ b/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsx@@ -12,10 +12,9 @@ import {type SocialSafeZonesProps = InteractiveBaseProps &InteractiveTransformProps & {- readonly direction?: 'ltr' | 'rtl';readonly forceVisibleForPreview?: boolean;readonly overlayOpacity?: number;- readonly platform?: 'instagram' | 'tiktok' | 'youtube';+ readonly platform?: 'instagram' | 'tiktok';readonly showInterface?: boolean;};@@ -28,25 +27,13 @@ const socialSafeZonesSchema = {keyframable: false,variants: {instagram: {},- tiktok: {- direction: {- type: 'enum',- default: 'ltr',- description: 'Interface direction',- keyframable: false,- variants: {- ltr: {},- rtl: {},- },- },- },- youtube: {},+ tiktok: {},},},showInterface: {type: 'boolean',default: true,- description: 'Show illustrative interface',+ description: 'Show interface reference',keyframable: false,},overlayOpacity: {@@ -71,7 +58,6 @@ const SocialSafeZonesInner = forwardRef<({controls,- direction = 'ltr',forceVisibleForPreview = false,name,overlayOpacity = 0.45,@@ -86,7 +72,6 @@ const SocialSafeZonesInner = forwardRef<const {height, width} = useVideoConfig();const {isRendering, isStudio} = useRemotionEnvironment();const maskId = `social-safe-zone-${useId().replaceAll(':', '')}`;- const isNineBySixteen = Math.abs(width / height - 9 / 16) < 0.001;useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);@@ -94,6 +79,23 @@ const SocialSafeZonesInner = forwardRef<return null;}+ // Both paths are measured from representative iOS captures of full-green+ // videos, rather than inferred from platform marketing material.+ //+ // TikTok: The 1290×2293 video region at y=139 in tiktok-layout.png was+ // mapped to 1080×1920. The path clears the search UI (ending at y=132),+ // the action rail (starting at x=949, y=803), and captions (y=1749).+ //+ // Instagram: The 1290×2550 Reels viewport in reels-layout.png displays a+ // 9:16 video with cover sizing. Mapping it back to 1080×1920 leaves the+ // visible source between x=54 and x=1026. The path clears the top controls+ // (ending at y=212), action rail (starting at x=927, y=1114), and captions+ // (y=1726).+ const safeAreaPath =+ platform === 'tiktok'+ ? 'M24 160 H1050 V780 H930 V1715 H24 Z'+ : 'M55 235 H1025 V1090 H900 V1700 H55 Z';+return (<Sequencelayout="none"@@ -115,14 +117,13 @@ const SocialSafeZonesInner = forwardRef<zIndex: 2147483647,}}>- {isNineBySixteen ? (- <svg- aria-hidden="true"- height="100%"- preserveAspectRatio="none"- viewBox="0 0 1080 1920"- width="100%"- >+ <svg+ aria-hidden="true"+ height="100%"+ preserveAspectRatio="xMidYMid meet"+ viewBox="0 0 1080 1920"+ width="100%"+ ><defs><filterid={`${maskId}-shadow`}@@ -148,45 +149,7 @@ const SocialSafeZonesInner = forwardRef<y="0"><rect fill="white" height="1920" width="1080" />- {platform === 'tiktok' ? (- // Checked 2026-08-24 against TikTok's official 720×1280- // In-Feed Standard LTR template. Original safe polygon:- // M80 160 H640 V560 H520 V840 H80 Z- // https://ads.tiktok.com/help/article/tiktok-auction-in-feed-ads- <path- d="M120 240 H960 V840 H780 V1260 H120 Z"- fill="black"- transform={- direction === 'rtl'- ? 'translate(1080 0) scale(-1 1)'- : undefined- }- />- ) : null}- {platform === 'instagram' ? (- // Checked 2026-08-24 against Meta's official Reels ad- // guidance: 14% top, 35% bottom, and 6% on each side.- // https://www.facebook.com/business/ads-guide/update/video/instagram-reels- <rect- fill="black"- height="979.2"- width="950.4"- x="64.8"- y="268.8"- />- ) : null}- {platform === 'youtube' ? (- // Checked 2026-08-24 against Google Ads' official- // 1080×1920 vertical-video safe-zone diagram.- // https://support.google.com/google-ads/answer/9128498- <rect- fill="black"- height="960"- width="840"- x="48"- y="288"- />- ) : null}+ <path d={safeAreaPath} fill="black" /></mask></defs>@@ -198,194 +161,173 @@ const SocialSafeZonesInner = forwardRef<width="1080"/>- {platform === 'tiktok' ? (- <>- <path- d="M120 240 H960 V840 H780 V1260 H120 Z"- fill="none"- stroke="#c8ff3d"- strokeDasharray="22 16"- strokeWidth="8"- transform={- direction === 'rtl'- ? 'translate(1080 0) scale(-1 1)'- : undefined- }- />- {showInterface ? (- <g- fill="none"- stroke="white"- strokeLinecap="round"- strokeLinejoin="round"- strokeWidth="11"- transform={- direction === 'rtl'- ? 'translate(1080 0) scale(-1 1)'- : undefined- }- >- <path d="M385 124 H695" opacity="0.85" />- <path d="M435 172 H645" opacity="0.55" />- <circle cx="904" cy="870" r="43" />- <path d="M878 1000 Q904 970 930 1000 Q950 1025 904 1060 Q858 1025 878 1000 Z" />- <path d="M875 1140 H933 V1178 H909 L883 1202 V1178 H875 Z" />- <path d="M878 1304 L936 1275 L918 1342 L902 1318 Z" />- <path d="M120 1440 H580" />- <path d="M120 1490 H485" opacity="0.7" />- <path d="M120 1540 H390" opacity="0.45" />- <rect height="96" rx="18" width="840" x="120" y="1660" />- <path d="M170 1708 H700" opacity="0.65" />- </g>- ) : null}- </>- ) : null}+ <path+ d={safeAreaPath}+ fill="none"+ stroke="#c8ff3d"+ strokeDasharray="22 16"+ strokeWidth="8"+ />- {platform === 'instagram' ? (- <>- <rect+ {platform === 'tiktok' && showInterface ? (+ <g+ filter={`url(#${maskId}-shadow)`}+ fontFamily="Arial, Helvetica, sans-serif"+ >+ <gfill="none"- height="979.2"- stroke="#c8ff3d"- strokeDasharray="22 16"- strokeWidth="8"- width="950.4"- x="64.8"- y="268.8"- />- {showInterface ? (- <g+ stroke="white"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="5"+ >+ <path d="M64 66 L44 87 L64 108" strokeWidth="7" />+ <rect height="90" rx="22" width="919" x="121" y="42" />+ <circle cx="168" cy="85" r="19" />+ <path d="M182 99 L196 113" />+ <path d="M856 58 V116" opacity="0.35" strokeWidth="2" />+ </g>+ <text fill="white" fontSize="31" fontWeight="600" x="216" y="97">+ Search+ </text>+ <text fill="white" fontSize="29" fontWeight="700" x="896" y="97">+ Search+ </text>++ <g stroke="white" strokeLinejoin="round">+ <circle+ cx="1003"+ cy="829"+ fill="rgba(255, 255, 255, 0.18)"+ r="29"+ stroke="none"+ />+ <circle cx="1003" cy="829" fill="none" r="17" strokeWidth="5" />+ <circle cx="996" cy="829" fill="white" r="2.5" stroke="none" />+ <circle cx="1003" cy="829" fill="white" r="2.5" stroke="none" />+ <circle cx="1010" cy="829" fill="white" r="2.5" stroke="none" />++ <circle cx="1003" cy="973" fill="#dadde1" r="52" strokeWidth="4" />+ <circle cx="1003" cy="960" fill="none" r="17" stroke="#555b63" strokeWidth="5" />+ <path+ d="M971 1000 Q1003 972 1035 1000"fill="none"- stroke="white"- strokeLinecap="round"- strokeLinejoin="round"- strokeWidth="11"- >- <path d="M90 132 H310" />- <path d="M910 105 L970 165 M970 105 L910 165" />- <circle cx="1042" cy="1000" r="22" />- <path d="M1024 1125 Q1042 1105 1060 1125 Q1072 1142 1042 1165 Q1012 1142 1024 1125 Z" />- <path d="M1018 1260 H1066 V1292 H1047 L1026 1312 V1292 H1018 Z" />- <path d="M1018 1410 L1068 1385 L1053 1442 L1039 1422 Z" />- <circle cx="125" cy="1425" r="46" />- <path d="M205 1408 H690" />- <path d="M205 1455 H595" opacity="0.65" />- <path d="M125 1540 H660" opacity="0.55" />- <rect height="92" rx="46" width="830" x="90" y="1690" />- <circle cx="978" cy="1736" r="34" />- </g>- ) : null}- </>+ stroke="#555b63"+ strokeWidth="5"+ />+ <circle cx="1003" cy="1025" fill="#fe2c55" r="25" stroke="none" />+ <path d="M991 1025 H1015 M1003 1013 V1037" fill="none" strokeWidth="5" />++ <path+ d="M1003 1186 C991 1176 968 1161 968 1138 C968 1118 993 1110 1003 1128 C1013 1110 1038 1118 1038 1138 C1038 1161 1015 1176 1003 1186 Z"+ fill="white"+ stroke="none"+ />+ <path+ d="M973 1297 H1033 V1340 H1012 L989 1360 V1340 H973 Z"+ fill="white"+ stroke="none"+ />+ <path+ d="M979 1460 H1027 V1520 L1003 1504 L979 1520 Z"+ fill="white"+ stroke="none"+ />+ <path+ d="M968 1650 L1017 1611 V1634 C1040 1638 1052 1654 1056 1678 C1045 1664 1033 1659 1017 1659 V1682 Z"+ fill="white"+ stroke="none"+ />+ <circle cx="1003" cy="1867" fill="#dadde1" r="37" strokeWidth="4" />+ </g>+ <g fill="white" fontSize="24" fontWeight="600" textAnchor="middle">+ <text x="1003" y="1234">12K</text>+ <text x="1003" y="1402">306</text>+ <text x="1003" y="1570">1K</text>+ <text x="1003" y="1731">Share</text>+ </g>+ <g fill="white">+ <text fontSize="34" fontWeight="700" x="31" y="1782">+ @creator+ </text>+ <text fontSize="32" x="31" y="1848">+ Caption text for your video+ </text>+ <text fontSize="32" fontWeight="700" x="31" y="1896">+ #hashtag · more+ </text>+ </g>+ </g>) : null}- {platform === 'youtube' ? (- <>- <rect- fill="none"- height="960"- stroke="#c8ff3d"- strokeDasharray="22 16"- strokeWidth="8"- width="840"- x="48"- y="288"- />- {showInterface ? (- <g+ {platform === 'instagram' && showInterface ? (+ <g+ filter={`url(#${maskId}-shadow)`}+ fontFamily="Arial, Helvetica, sans-serif"+ >+ <rect fill="black" height="82" rx="41" width="482" x="313" y="26" />+ <text fill="white" fontSize="31" fontWeight="600" x="127" y="77">+ 9:41+ </text>+ <g fill="none" stroke="white" strokeLinecap="round" strokeWidth="6">+ <path d="M151 168 L127 190 L151 212" />+ <circle cx="950" cy="188" r="21" />+ <path d="M966 204 L980 218" />+ <path d="M833 69 Q851 48 869 69 M840 77 Q851 65 862 77" strokeWidth="5" />+ <rect height="29" rx="7" width="55" x="890" y="53" />+ </g>++ <g fill="white" stroke="white" strokeLinejoin="round">+ <path+ d="M956 1163 C944 1153 930 1142 930 1127 C930 1110 949 1103 956 1118 C963 1103 982 1110 982 1127 C982 1142 968 1153 956 1163 Z"+ fill="none"+ strokeWidth="6"+ />+ <path+ d="M931 1281 H981 V1317 H964 L944 1334 V1317 H931 Z"+ fill="none"+ strokeWidth="6"+ />+ <path+ d="M932 1387 H974 M974 1387 L961 1374 M974 1387 L961 1400 M980 1421 H938 M938 1421 L951 1408 M938 1421 L951 1434"fill="none"- stroke="white"strokeLinecap="round"- strokeLinejoin="round"- strokeWidth="11"- >- <path d="M75 140 H280" />- <circle cx="954" cy="770" r="43" />- <path d="M928 920 Q954 890 980 920 Q1000 945 954 980 Q908 945 928 920 Z" />- <path d="M925 1070 H983 V1108 H959 L933 1132 V1108 H925 Z" />- <path d="M928 1228 L986 1198 L968 1266 L952 1242 Z" />- <circle cx="950" cy="1410" r="48" />- <path d="M72 1410 H700" />- <path d="M72 1465 H575" opacity="0.65" />- <circle cx="120" cy="1580" r="48" />- <path d="M205 1562 H650" />- <path d="M205 1610 H500" opacity="0.55" />- <rect height="92" rx="20" width="820" x="72" y="1730" />- </g>- ) : null}- </>+ strokeWidth="6"+ />+ <path+ d="M930 1569 L982 1544 L965 1601 L951 1579 Z"+ fill="none"+ strokeWidth="6"+ />+ <path d="M934 1719 H978 M934 1738 H966" fill="none" strokeLinecap="round" strokeWidth="6" />+ </g>+ <g fill="white" fontSize="24" fontWeight="600" textAnchor="middle">+ <text x="956" y="1217">21</text>+ <text x="956" y="1356">1</text>+ <text x="956" y="1492">8</text>+ <text x="956" y="1648">Share</text>+ </g>+ <circle cx="130" cy="1766" fill="#dadde1" r="40" stroke="white" strokeWidth="4" />+ <g fill="white">+ <text fontSize="31" fontWeight="700" x="191" y="1755">+ creator+ </text>+ <rect fill="none" height="48" rx="14" stroke="white" strokeWidth="3" width="122" x="480" y="1718" />+ <text fontSize="27" fontWeight="700" x="501" y="1752">+ Follow+ </text>+ <text fontSize="27" opacity="0.75" x="191" y="1800">+ ♫ Original audio+ </text>+ <text fontSize="31" x="92" y="1858">+ Caption text #hashtag · more+ </text>+ </g>+ <rect fill="#dadde1" height="68" rx="16" stroke="white" strokeWidth="4" width="68" x="922" y="1805" />+ </g>) : null}- <g filter={`url(#${maskId}-shadow)`}>- <rect- fill="#111318"- height="76"- rx="18"- width="610"- x="40"- y="40"- />- <text- fill="white"- fontFamily="Arial, Helvetica, sans-serif"- fontSize="31"- fontWeight="700"- x="72"- y="90"- >- {platform === 'tiktok'- ? 'TikTok · In-Feed ad reference'- : platform === 'instagram'- ? 'Instagram · Reels ad reference'- : 'YouTube · Vertical ad reference'}- </text>- </g>- <text- fill="#c8ff3d"- fontFamily="Arial, Helvetica, sans-serif"- fontSize="29"- fontWeight="700"- letterSpacing="4"- paintOrder="stroke"- stroke="#111318"- strokeWidth="9"- textAnchor="middle"- x="540"- y={platform === 'youtube' ? 345 : 325}- >- SAFE AREA- </text>- </svg>- ) : (- <div- style={{- alignItems: 'center',- display: 'flex',- height: '100%',- justifyContent: 'center',- padding: Math.max(24, Math.min(width, height) * 0.05),- width: '100%',- }}- >- <div- style={{- backgroundColor: 'rgba(17, 19, 24, 0.92)',- border: '3px solid #ff3158',- borderRadius: 18,- boxShadow: '0 8px 28px rgba(0, 0, 0, 0.35)',- color: 'white',- fontFamily: 'Arial, Helvetica, sans-serif',- fontSize: Math.max(20, Math.min(width, height) * 0.035),- fontWeight: 700,- lineHeight: 1.3,- maxWidth: 720,- padding: '24px 32px',- textAlign: 'center',- }}- >- Social Safe Zones is calibrated for 9:16 compositions- </div>- </div>- )}+ </svg></div></Sequence>);diff --git a/packages/docs/src/components/Elements/SocialSafeZonesPreview.tsx b/packages/docs/src/components/Elements/SocialSafeZonesPreview.tsxindex 02a5e7f95a..6440befec1 100644--- a/packages/docs/src/components/Elements/SocialSafeZonesPreview.tsx+++ b/packages/docs/src/components/Elements/SocialSafeZonesPreview.tsx@@ -4,12 +4,10 @@ import {SocialSafeZones} from '../../../elements/overlays/social-safe-zones/sociexport const SocialSafeZonesPreview: React.FC = () => {return (<SocialSafeZones- direction="ltr"forceVisibleForPreviewname="Social safe zones"overlayOpacity={0.45}- platform="tiktok"- showInterface+ platform={'instagram'}/>);};diff --git a/packages/docs/src/components/Elements/element-definitions.ts b/packages/docs/src/components/Elements/element-definitions.tsindex b6b3ddf76c..3d9e7f0a6c 100644--- a/packages/docs/src/components/Elements/element-definitions.ts+++ b/packages/docs/src/components/Elements/element-definitions.ts@@ -251,7 +251,7 @@ const elementImplementations = {component: SocialSafeZonesPreview,contributors: [],description:- 'Source-backed safe-area guides for TikTok, Instagram Reels, and YouTube vertical video.',+ 'Capture-calibrated safe-area guides for TikTok and Instagram Reels.',dependencies: [],durationInFrames: 120,elementHeight: null,