🎥 Make videos programmatically with React
Elements: Render social safe zones normally
Igor Samokhovets12cc6942a7ab
diff --git a/packages/docs/elements/overlays/social-safe-zones/index.mdx b/packages/docs/elements/overlays/social-safe-zones/index.mdxindex bf8017b902..d57063667a 100644--- a/packages/docs/elements/overlays/social-safe-zones/index.mdx+++ b/packages/docs/elements/overlays/social-safe-zones/index.mdx@@ -15,4 +15,4 @@ import {elementDefinitions} from '@site/src/components/Elements/element-definitiThe presets were measured at 9:16 from representative iOS captures of full-green videos in TikTok and Instagram Reels. The interface references are transparent images extracted from those captures, rather than redrawn approximations. Author-specific text and avatars were replaced with generic content. 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, 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.+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 rendered like any other Element, so hide or remove it when it should not appear in the final video.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 dbcec21da3..729c1f6702 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@@ -7,13 +7,11 @@ import {type InteractiveTransformProps,type InteractivitySchema,type SequenceControls,- useRemotionEnvironment,useVideoConfig,} from 'remotion';type SocialSafeZonesProps = InteractiveBaseProps &InteractiveTransformProps & {- readonly forceVisibleForPreview?: boolean;readonly overlayOpacity?: number;readonly platform?: 'instagram' | 'tiktok';readonly showInterface?: boolean;@@ -23,7 +21,7 @@ const socialSafeZonesSchema = {...Interactive.baseSchema,platform: {type: 'enum',- default: 'tiktok',+ default: 'instagram',description: 'Platform',keyframable: false,variants: {@@ -47,7 +45,6 @@ const socialSafeZonesSchema = {hiddenFromList: false,keyframable: false,},- forceVisibleForPreview: {type: 'hidden'},} as const satisfies InteractivitySchema;const SocialSafeZonesInner = forwardRef<@@ -59,10 +56,9 @@ const SocialSafeZonesInner = forwardRef<({controls,- forceVisibleForPreview = false,name,overlayOpacity = 0.45,- platform = 'tiktok',+ platform = 'instagram',showInterface = true,style,...sequenceProps@@ -71,15 +67,10 @@ const SocialSafeZonesInner = forwardRef<) => {const outlineRef = useRef<HTMLDivElement>(null);const {height, width} = useVideoConfig();- const {isRendering, isStudio} = useRemotionEnvironment();const maskId = `social-safe-zone-${useId().replaceAll(':', '')}`;useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);- if ((!isStudio || isRendering) && !forceVisibleForPreview) {- return null;- }-// Both paths and interface references are measured from representative// iOS captures of full-green videos, rather than inferred from platform// marketing material. Author-specific text and avatars were replaced indiff --git a/packages/docs/src/components/Elements/SocialSafeZonesPreview.tsx b/packages/docs/src/components/Elements/SocialSafeZonesPreview.tsxdeleted file mode 100644index 6440befec1..0000000000--- a/packages/docs/src/components/Elements/SocialSafeZonesPreview.tsx+++ /dev/null@@ -1,13 +0,0 @@-import React from 'react';-import {SocialSafeZones} from '../../../elements/overlays/social-safe-zones/social-safe-zones';--export const SocialSafeZonesPreview: React.FC = () => {- return (- <SocialSafeZones- forceVisibleForPreview- name="Social safe zones"- overlayOpacity={0.45}- platform={'instagram'}- />- );-};diff --git a/packages/docs/src/components/Elements/element-definitions.ts b/packages/docs/src/components/Elements/element-definitions.tsindex 926d491cee..a6f5371f0c 100644--- a/packages/docs/src/components/Elements/element-definitions.ts+++ b/packages/docs/src/components/Elements/element-definitions.ts@@ -26,6 +26,7 @@ import {MapFlyover} from '../../../elements/maps/map-flyover/a-to-b-map-flyover'import {WatercolorMap} from '../../../elements/maps/watercolor-map/watercolor-map';import {LocationLowerThird} from '../../../elements/overlays/location-lower-third/location-lower-third';import {NameLowerThird} from '../../../elements/overlays/name-lower-third/name-lower-third';+import {SocialSafeZones} from '../../../elements/overlays/social-safe-zones/social-safe-zones';import {OnScreenMessages} from '../../../elements/storytelling/on-screen-messages/on-screen-messages';import {PolaroidPictures} from '../../../elements/storytelling/polaroid-pictures/polaroid-pictures';import {CircleMarker} from '../../../elements/text/circle-marker/circle-marker';@@ -43,7 +44,6 @@ import {type ElementCategory,type ElementSlug,} from './element-registry';-import {SocialSafeZonesPreview} from './SocialSafeZonesPreview';export type ElementPreviewMetadata = {readonly posterUrl:@@ -278,7 +278,7 @@ const elementImplementations = {width: 1920,},'overlays/social-safe-zones': {- component: SocialSafeZonesPreview,+ component: SocialSafeZones,contributors: [],description:'Capture-calibrated safe-area guides for TikTok and Instagram Reels.',