Chuyển đến nội dung
Skillpedia
Dựng video48k · #5611

remotion-interactivity

Skill này làm gì

Tool này giúp video Remotion của bạn có tính tương tác hơn. Nó cho phép bạn điều khiển các phần tử như chữ và hình ảnh trực tiếp trong trình chỉnh sửa, bao gồm chọn, di chuyển, đổi kích thước và xoay.

Khi nào nên dùng

  • ✓Khi bạn muốn người xem tương tác với các phần tử trong video.
  • ✓Khi bạn tạo video mà một số phần cần có thể chỉnh sửa.
  • ✓Khi bạn muốn đơn giản hóa việc chỉnh sửa kiểu dáng và hoạt ảnh trong video Remotion.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/remotion-interactivity/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/remotion-interactivity/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm thế nào để tiêu đề video của tôi có thể được chọn và đổi kích thước trong trình chỉnh sửa?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn dùng một đoạn code đặc biệt gọi là `Interactive` bao quanh các phần tử HTML bạn muốn làm tương tác. Điều quan trọng là đặt tên cho từng phần tử và viết kiểu dáng cùng hoạt ảnh một cách đơn giản, trực tiếp trong code.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

When to Use

  • Use when this upstream workflow matches the user's stated goal.
  • Use when the task requires the procedures documented in this skill.

By writing Remotion markup in a specific way, the Remotion Studio is able to recognize the structure of the code and makes it interactive:

  • Allowing items to be selected by clicking on them
  • Allowing drag+drop, resizing and rotation
  • Editing the CSS styles
  • Making keyframes and easing values editable

If the markup is too complex for the Studio to make it interactive, then the values become grayed out.

Make an HTML element interactive using Interactive

Every HTML and SVG element (except <Img>, it already is interactive) such as <div> can be turned interactive using Interactive:

<Interactive.Div
  name="Greeting card"
  style={{fontSize: 80, padding: 24}}
>
  Hello
</Interactive.Div>

This allows styles and keyframes to be set in the Studio. Be sensible, if a component has many elements, the timeline might get messy.

Prefer inline text

If text is fixed and only used once, write it directly inside the interactive element instead of extracting it into a constant.

// 👍 Fixed copy stays editable
<Interactive.Div name="Title">
  Remotion Best Practices
</Interactive.Div>

Use a prop or variable only when the text is dynamic or reused.

Give interactive elements a descriptive name

Add a name prop to elements to make them easily identifyable. Avoid computed names, hardcode them.

<>
  <Interactive.Div name="Hero title" style={{fontSize: 80}}>
    Launch day
  </Interactive.Div>
  <Img name="Avatar" src="https://remotion.media/image.jpeg" />
  <Video name="Background" src="https://remotion.media/video.mp4" />
  <Sequence name="Title">
    Launch day
  </Sequence>
</>

Keep all CSS styles inline

The best way is to just pass a plain object to style - no referring to constants, no object spreading, no math.

<Interactive.Div
  style={{
    fontSize: 80,
    color: 'red',
  }}
>
  Hello World!
</Interactive.Div>
const baseStyle = useMemo(() => {
  return {
    fontSize: 12 // ❌ Non-inline styles are not supported
  }
}, []);

<Interactive.Div
  style={{
    ...baseStyle, // ❌ Spreading is not supported
    color: RED, // ❌ Referring to constants is not supported
    scale: frame * 10 // ❌ Math is not supported
  }}
>
  Hello World!
</Interactive.Div>

Animate using interpolate()

Write animations as inline interpolate() calls on the property that changes.
The output range, easing, extrapolation and output property should use hardcoded values.

The input range may additionally use durationInFrames, fps, width and height destructured directly from useVideoConfig(). Bare identifiers such as durationInFrames, multiplication with a number such as 2 * fps or fps * 2, and subtraction of a number such as durationInFrames - 1 are supported.

const {fps, durationInFrames} = useVideoConfig();

// 👍 Inline values can be standardized and keyframed
<Interactive.Div
  name="Product card"
  style={{
    color: 'white',
    fontSize: 80,
    scale: interpolate(frame, [0, fps], [0, 1], {
      easing: Easing.spring({damping: 200}),
      output: 'perceptual-scale',
      extrapolateLeft: 'clamp',
      extrapolateRight: 'clamp'
    }),
    rotate: interpolate(frame, [0, 1 * fps], ['0deg', '20deg'], {
      easing: Easing.spring({damping: 200}),
      extrapolateLeft: 'clamp',
      extrapolateRight: 'clamp'
    }),
    translate: interpolate(
      frame,
      [durationInFrames - 30, durationInFrames],
      ['0px 0px', '0px 120px'],
      {
        easing: Easing.spring({damping: 200}),
        output: 'perceptual-scale',
        extrapolateLeft: 'clamp',
        extrapolateRight: 'clamp'
      }
    ),
  }}
/>
const translateY = interpolate(frame, [0, 30], [0, 120]); // ❌ Math should be directly in the markup

<Interactive.Div
  name="Product card"
  style={{
    translate: translateY, // ❌ Only inline interpolate() calls are supported,
    rotate: interpolate(frame, [start, start + 10], [0, Math.PI]), // ❌ Cannot use math with arbitrary variables, cannot use constants
    scale: interpolate(anyVariable, [0, 30], [0, 1]) // ❌ Can only interpret the `frame` variable.
  }}
/>

…
Câu hỏi thường gặp

“Tương tác” trong ngữ cảnh này nghĩa là gì?

Nghĩa là bạn có thể dùng trình chỉnh sửa Remotion để nhấp, kéo, đổi kích thước và xoay các phần tử của video, tương tự như thao tác với đối tượng trong một chương trình thiết kế.

Vì sao tôi cần viết code theo một cách cụ thể?

Trình chỉnh sửa Remotion tìm một mẫu cụ thể trong code để biết phần nào của video có thể điều khiển. Viết theo cách này giúp trình chỉnh sửa hiểu và cung cấp các tùy chọn tương tác.

Tôi có thể tạo hoạt ảnh cho mọi thứ không?

Bạn có thể tạo hoạt ảnh cho các thuộc tính như tỷ lệ, góc xoay và vị trí bằng hàm `interpolate()`, nhưng các giá trị cần được viết trực tiếp trong code, không có phép tính phức tạp hoặc biến bên ngoài.

Chi tiết

Mô tả gốc của tác giả

Structure Remotion markup for interactivity

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5611
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự