Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>MotionDivNew to Visual Studio Code? Get it now.
MotionDiv

MotionDiv

Anshuman1313

|
20 installs
| (1) | Free
Convert HTML and SVG elements into Motion components and automatically manage Motion imports.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

MotionDiv

Convert HTML and SVG elements into Motion components directly inside VS Code.

You can convert a <div> into a motion.div instantly.

Select a <div> and press Ctrl + Shift + M.

Automatically handles "framer-motion" → "motion/react" imports.

MotionDiv Demo

Example Workflow

Manual

Select div
↓
Import motion
↓
Change opening tag
↓
Change closing tag
↓
Verify everything

MotionDiv

Select div
↓
Shortcut
↓
Done

Real Workflow

MotionDiv Demo

Features

  • Convert supported HTML elements to Motion components
  • Convert supported SVG elements to Motion components
  • Automatically adds Motion import when needed
  • Preserves nested structures
  • Single-step undo support
  • Places cursor after the Motion tag for faster editing

Supported Tags

HTML Elements

  • div
  • section
  • article
  • header
  • footer
  • nav
  • main
  • img
  • span
  • button
  • a
  • ul
  • li
  • p
  • h1
  • h2
  • h3
  • h4
  • h5
  • h6

SVG Elements

  • svg
  • g
  • path
  • circle
  • rect

Installation

  1. Open VS Code
  2. Open Extensions
  3. Search for MotionDiv
  4. Click Install

Usage

Place your cursor on the opening tag and run the MotionDiv command using the keyboard shortcut:

Ctrl + Shift + M

Example

Before:


<div>

  Hello World

</div>

After:


<motion.div>

  Hello World

</motion.div>

SVG Example

Before:


<circle cx="50" cy="50" r="20"></circle>

After:


<motion.circle cx="50" cy="50" r="20"></motion.circle>

Automatic Import Handling

MotionDiv automatically:

  • Detects existing Motion imports
  • Inserts the Motion import after existing imports
  • Places the import after "use client" when no imports exist
  • Inserts at the top of the file when needed

Current Limitations

  • Cursor should be placed on the opening tag
  • Not all Motion-supported elements are currently included
  • Advanced JSX/AST-based element detection is planned for future versions

Feedback

Found a bug or have a feature request?

Open an issue on GitHub.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft