Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/mdx-embed/src/components/figma/figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ export interface IFigmaProps {
* The url to the file or frame. Make sure to include the node-id if present
*/
url: string;
/**
* Show Figma UI
*/
showUI: boolean;
}

export const Figma: FunctionComponent<IFigmaProps> = ({ title, height = 450, url }: IFigmaProps) => {
export const Figma: FunctionComponent<IFigmaProps> = ({ title, height = 450, url, showUI = true }: IFigmaProps) => {
const regex = /(file|proto)\/([0-9a-zA-Z]{22,128})(?:\/.*)?$/;
if (!regex.test(url)) {
return null;
Expand All @@ -30,7 +34,7 @@ export const Figma: FunctionComponent<IFigmaProps> = ({ title, height = 450, url
width: '100%',
}}
scrolling="no"
src={`https://www.figma.com/embed?embed_host=mdx-embed&url=https://www.figma.com/${url}`}
src={`https://www.figma.com/embed?embed_host=mdx-embed&show_ui=${showUI ? 1 : 0}&url=https://www.figma.com/${url}`}
frameBorder="no"
allowFullScreen
/>
Expand Down