Skip to content

FigmaX

Learn how to use the FigmaX component to embed Figma designs, prototypes, and components with flexible sizing and responsive behavior.

The FigmaX component provides an easy way to embed Figma designs, prototypes, and components directly in your documentation with flexible sizing options and responsive behavior. It supports custom dimensions, lazy loading, and automatically adapts to different screen sizes and themes.


Prop NameProp TypeDescriptionDefault
urlstringThe Figma embed URL (required)-
widthstringWidth of the embed (CSS units)"100%"
heightstringHeight of the embed (CSS units)"450px"

The simplest way to embed a Figma design is to provide the embed URL.

To get the proper embed URL from Figma:

  1. Open your Figma file, prototype, or component
  2. Click the “Share” button in the top right
  3. Click “Get embed code”
  4. Copy the URL from the src attribute of the iframe code
<FigmaX url="https://www.figma.com/embed?embed_host=share&url=YOUR_FIGMA_URL" />

The FigmaX component supports various sizing options using standard CSS units.

<FigmaX
url="https://www.figma.com/embed?embed_host=share&url=..."
width="800px"
height="600px"
/>
<FigmaX
url="https://www.figma.com/embed?embed_host=share&url=..."
width="80%"
height="500px"
/>
<FigmaX
url="https://www.figma.com/embed?embed_host=share&url=..."
width="90vw"
height="70vh"
/>
<FigmaX
url="https://www.figma.com/embed?embed_host=share&url=..."
width="100%"
height="30rem"
/>

For mobile prototypes, use appropriate dimensions:

<div style="max-width: 375px; margin: 0 auto;">
<FigmaX
url="https://www.figma.com/embed?embed_host=share&url=..."
width="100%"
height="812px"
/>
</div>

Compare multiple designs using the GridX component:

<GridX cols={2} gap="1rem">
<FigmaX
slot="col1"
url="https://www.figma.com/embed?embed_host=share&url=..."
height="400px"
/>
<FigmaX
slot="col2"
url="https://www.figma.com/embed?embed_host=share&url=..."
height="400px"
/>
</GridX>

For responsive behavior, use percentage widths and viewport units:

<FigmaX
url="https://www.figma.com/embed?embed_host=share&url=..."
width="100%"
height="min(70vh, 600px)"
/>

The FigmaX component supports various types of Figma content:

Embed complete design files or specific frames:

<FigmaX url="https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/file/..." />

Embed prototypes with transitions and interactions:

<FigmaX
url="https://www.figma.com/embed?embed_host=share&url=https://www.figma.com/proto/..."
width="375px"
height="812px"
/>

Showcase individual components from your design system:

<FigmaX
url="https://www.figma.com/embed?embed_host=share&url=..."
width="100%"
height="400px"
/>

Embed collaborative whiteboard content:

<FigmaX
url="https://www.figma.com/embed?embed_host=share&url=..."
width="100%"
height="600px"
/>

  • Use appropriate dimensions based on your content type (mobile prototypes vs. desktop designs)
  • Test embed URLs to ensure they work correctly and have proper permissions
  • Consider using percentage widths for responsive behavior
  • Use viewport units for full-screen experiences when appropriate
  • Provide meaningful context around embedded designs
  • Ensure Figma files have proper sharing permissions for embedding

  • Don’t use regular Figma share URLs - Always use the embed URL from “Get embed code”
  • Don’t embed private files without proper permissions - Ensure files are accessible to your audience
  • Don’t use fixed pixel dimensions for responsive layouts - Use percentages or viewport units instead
  • Don’t embed too many large files on one page - This can impact performance
  • Don’t forget to test embeds - URLs can change if files are moved or permissions change
  • Don’t use extremely large dimensions - Consider your users’ screen sizes and bandwidth