Skip to content

🎥 Make videos programmatically with React

Docs: Document snapping in the Editor Starter

Jonny Burgerdf9184b92113
diff --git a/packages/docs/docs/editor-starter/features-not-included.mdx b/packages/docs/docs/editor-starter/features-not-included.mdx
index e2c4ba5565..c15d180e96 100644
--- a/packages/docs/docs/editor-starter/features-not-included.mdx
+++ b/packages/docs/docs/editor-starter/features-not-included.mdx
@@ -93,10 +93,6 @@ See: [Captioning - Limits](/docs/editor-starter/captioning#limits)
There is only one theme, a dark one.
-## Snapping on the canvas
-
-Magnetic "snapping" that aligns items based on the position of other items is only implemented for the timeline, but not for the canvas.
-
## See also
- [Features included in the Editor Starter](/docs/editor-starter/features)
diff --git a/packages/docs/docs/editor-starter/features.mdx b/packages/docs/docs/editor-starter/features.mdx
index 775a34cbcf..ae887313a1 100644
--- a/packages/docs/docs/editor-starter/features.mdx
+++ b/packages/docs/docs/editor-starter/features.mdx
@@ -186,17 +186,11 @@ Feature flag: [`FEATURE_FOLLOW_PLAYHEAD_WHILE_PLAYING`](https://github.com/searc
Scrolls the timeline as the playhead moves forward.
-### Timeline snapping
+### Timeline Snapping
Feature flag: [`FEATURE_TIMELINE_SNAPPING`](https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20FEATURE_TIMELINE_SNAPPING&type=code)
-Enables snapping on the timeline, allowing items to align with other items, the playhead, or grid positions when dragged. This simplifies positioning and transitions. Activate snapping by clicking the magnet icon in the top right corner.
-
-### Snapping toggle shortcut
-
-Feature flag: [`FEATURE_SNAPPING_SHORTCUT`](https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20FEATURE_SNAPPING_SHORTCUT&type=code)
-
-Allows toggling timeline snapping on/off using the keyboard shortcut <kbd>Shift</kbd>+<kbd>M</kbd>. When this feature is enabled, you can temporarily (de)activate snapping using the shortcut.
+Enables snapping on the timeline, allowing items to align with other items, the playhead, or grid positions when dragged. This simplifies positioning and transitions. Activate snapping by clicking the magnet icon.
## Inspector
@@ -533,6 +527,12 @@ Feature flags: [`FEATURE_BRING_TO_FRONT`](https://github.com/search?q=repo%3Arem
Right-clicking on an item shows a menu with options to bring the item to front or send it to back.
+### Canvas snapping
+
+Feature flag: [`FEATURE_CANVAS_SNAPPING`](https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20FEATURE_CANVAS_SNAPPING&type=code)
+
+Enables snapping on the canvas, allowing items to align with other items, the playhead, or grid positions when dragged. This simplifies positioning and transitions. Activate snapping by clicking the magnet icon.
+
## Cropping
Feature flag: [`FEATURE_CROPPING`](https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20FEATURE_CROPPING&type=code)
@@ -597,6 +597,12 @@ Feature flags: [`FEATURE_UNDO_SHORTCUT`](https://github.com/search?q=repo%3Aremo
Use <kbd>Cmd</kbd>/<kbd>Ctrl</kbd>+<kbd>Z</kbd> to undo and <kbd>Cmd</kbd>/<kbd>Ctrl</kbd>+<kbd>Y</kbd> or <kbd>Cmd</kbd>/<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Z</kbd> to redo actions.
+### Snapping toggle shortcut
+
+Feature flag: [`FEATURE_SNAPPING_SHORTCUT`](https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20FEATURE_SNAPPING_SHORTCUT&type=code)
+
+Allows toggling timeline and canvas snapping on/off using the keyboard shortcut <kbd>Shift</kbd>+<kbd>M</kbd>. When this feature is enabled, you can temporarily (de)activate snapping using the shortcut.
+
### Asset caching
Feature flag: [`FEATURE_CACHE_ASSETS_LOCALLY`](https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20FEATURE_CACHE_ASSETS_LOCALLY&type=code)
@@ -803,7 +809,7 @@ Leads to smoother playback and faster rendering, [but may have some rough edges]
<div style={{width: 2, display: 'inline-block'}} />
<kbd>M</kbd>
</td>
- <td style={{verticalAlign: 'middle'}}>Toggle timeline snapping</td>
+ <td style={{verticalAlign: 'middle'}}>Toggle timeline and canvas snapping</td>
<td style={{verticalAlign: 'middle'}}><a href="https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20FEATURE_SNAPPING_SHORTCUT&type=code" target="_blank"><code>FEATURE_SNAPPING_SHORTCUT</code></a></td>
</tr>
</table>
diff --git a/packages/docs/docs/editor-starter/snapping.mdx b/packages/docs/docs/editor-starter/snapping.mdx
new file mode 100644
index 0000000000..5a3ad62e58
--- /dev/null
+++ b/packages/docs/docs/editor-starter/snapping.mdx
@@ -0,0 +1,39 @@
+---
+image: /generated/articles-docs-editor-starter-snapping.png
+title: Snapping in the Editor Starter
+sidebar_label: Snapping
+id: snapping
+crumb: Editor Starter
+---
+
+There are two types of snapping in the Editor Starter:
+
+- Timeline snapping
+- Canvas snapping
+
+## Enabling snapping
+
+There is a magnet icon in the toolbar that allows to enable and disable snapping.
+By default, this toggle is for both timeline and canvas snapping.
+
+Also, there are 2 feature flags to toggle the features globally:
+
+- [`FEATURE_TIMELINE_SNAPPING`](/docs/editor-starter/features#timeline-snapping)
+- [`FEATURE_CANVAS_SNAPPING`](/docs/editor-starter/features#canvas-snapping)
+
+There is a keyboard shortcut to toggle snapping: <kbd>Shift</kbd>+<kbd>M</kbd>.
+To toggle it, there is another feature flag:
+
+- [`FEATURE_SNAPPING_SHORTCUT`](/docs/editor-starter/features#snapping-toggle-shortcut)
+
+## Timeline snapping
+
+When timeline snapping is enabled, items in the timeline will snap to other items when dragging them.
+
+## Canvas snapping
+
+When canvas snapping is enabled, items in the canvas will snap to the edges of the canvas, or the center of the canvas, both horizontally and vertically.
+
+## Multiple items
+
+Both timeline and canvas snapping works also when multiple items are selected.
diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.ts
index d85d1d5fb4..afaec7348d 100644
--- a/packages/docs/sidebars.ts
+++ b/packages/docs/sidebars.ts
@@ -1420,6 +1420,7 @@ const sidebars: SidebarsConfig = {
'editor-starter/undo-redo',
'editor-starter/copy-paste',
'editor-starter/cropping',
+ 'editor-starter/snapping',
'editor-starter/fonts',
'editor-starter/asset-uploads',
'editor-starter/asset-cleanup',
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index 9983f40406..4a245a27f3 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -1502,6 +1502,15 @@ export const articles = [
noAi: false,
slug: 'editor-starter/setup',
},
+ {
+ id: 'snapping',
+ title: 'Snapping in the Editor Starter',
+ relativePath: 'docs/editor-starter/snapping.mdx',
+ compId: 'articles-docs-editor-starter-snapping',
+ crumb: 'Editor Starter',
+ noAi: false,
+ slug: 'editor-starter/snapping',
+ },
{
id: 'state-management',
title: 'State management in the Editor Starter',
diff --git a/packages/docs/static/generated/articles-docs-editor-starter-snapping.png b/packages/docs/static/generated/articles-docs-editor-starter-snapping.png
new file mode 100644
index 0000000000..7427f02afa
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-editor-starter-snapping.png differ