🎥 Make videos programmatically with React
layers
Jonny Burger84c73b744e51
diff --git a/packages/docs/docs/importing-assets.md b/packages/docs/docs/importing-assets.mdindex 55a13fa4f5..30bf0b5152 100644--- a/packages/docs/docs/importing-assets.md+++ b/packages/docs/docs/importing-assets.md@@ -2,6 +2,7 @@image: /generated/articles-docs-importing-assets.pngid: assetstitle: Importing assets+sidebar_label: Assetscrumb: "How To"---diff --git a/packages/docs/docs/layers.mdx b/packages/docs/docs/layers.mdxindex 33da30f261..47e705bee2 100644--- a/packages/docs/docs/layers.mdx+++ b/packages/docs/docs/layers.mdx@@ -30,5 +30,32 @@ export const MyComp: React.FC = () => {};```-This will render the text on top of the image.+This will render the text on top of the image.+If you want to only show an element for a certain duration, you can use a [`<Sequence>`](/docs/sequence) component, which by default is also absolutely positioned.++```tsx twoslash title="MyComp.tsx"+import React from "react";+import { AbsoluteFill, Img, staticFile, Sequence } from "remotion";++export const MyComp: React.FC = () => {+ return (+ <AbsoluteFill>+ <AbsoluteFill>+ <Img src={staticFile("bg.png")} />+ </AbsoluteFill>+ <Sequence from={60} durationInFrames={40}>+ <h1>This text appears after 60 frames!</h1>+ </Sequence>+ </AbsoluteFill>+ );+};+```++The lower the absolutely positioned element is in the tree, the higher it will be in the layer stack.+If you are aware of this, you can use this to your advantage and avoid using `z-index` in most cases.++## See also++- [`<AbsoluteFill>`](/docs/absolute-fill)+- [`<Sequence>`](/docs/sequence)diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex 83bbaee768..48c62f4e7a 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -510,8 +510,8 @@ module.exports = {label: "Designing videos",items: ["transforms",- "layers","assets",+ "layers","transitioning","use-img-and-iframe","using-audio",