37
loading...
This website collects cookies to deliver better user experience
But what if we could create a better experience? What if we could add the designs directly into the developers working environment and have those designs update in real time!
Bit is like Git but for Components. It gives you the ability to build components in isolation with it's own versioning system making it easier to publish and share components across multiple projects and repos.
When we create components in Bit we create them in a folder and inside we have an index file that exports everything as well as a component file, the component docs file, the test file, the composition file for viewing the component and the styles if needed.
<iframe
style="border: 1px solid rgba(0, 0, 0, 0.1);"
width="800"
height="450"
src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FDaShaxpMbyWlvOGMFFUHCl%2Fbutton%3Fnode-id%3D0%253A1"
allowfullscreen></iframe>
<iframe
title="button.docs.mdx"
style={{ border: '1px solid rgba(0, 0, 0, 0.1)' }}
width="800"
height="450"
src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FDaShaxpMbyWlvOGMFFUHCl%2Fbutton%3Fnode-id%3D0%253A1"
allowfullscreen></iframe>
loading = 'lazy';
import React from 'react';
import classNames from 'classnames';
import styles from './figma-embed.module.scss';
export type FigmaEmbedProps = {
/**
* src for figma embed. Click on Share button in Figma and click on 'Get embed code' and then copy the value of the src attribute from the iframe.
*/
iframeSrc: string,
/**
* add lazy loading
*/
loading?: 'lazy' | 'eager',
/**
* width of iframe
*/
width?: string,
/**
* height of iframe
*/
height?: string
} & React.HTMLAttributes<HTMLIFrameElement>;
export function FigmaEmbed({
iframeSrc,
loading = 'lazy',
width = '100%',
height = '600',
className
}: FigmaEmbedProps) {
return (
<iframe
className={classNames(styles.iframe, className)}
width={width}
height={height}
src={iframeSrc}
loading={loading}></iframe>
);
}
<FigmaEmbed iframeSrc="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FDaShaxpMbyWlvOGMFFUHCl%2Fbutton%3Fnode-id%3D0%253A1" />