Frame

Wrapper for Figma Frame.

Props

PropTypeDefaultNote
nameStringThe name to be displayed in the Figma Layers List
childrenNode
presetPreset
styleStyleNot all props
onSelectionEnterFunctionSelection enter event callback
onSelectionLeaveFunctionSelection leave event callback
onLayoutFunctionEvent is fired once the layout has been calculated
onNodeIdFuctionGetting Figma Node ID callback

Also, most of FrameNode fields supported as props.

Presets

Preset is an object, that contains Frame props:

PropType
nameString
widthNumber
heightNumber

Predefined presets can be used:

import {Frame, FRAME_PRESETS} from "react-figma";
...
<Frame preset={FRAME_PRESETS.iPhoneX}>
...
</Frame>

List of presets:

KeyNameWidthHeight
iPhoneXiPhone X375812
iPhone8PlusiPhone 8 Plus414736
iPhone8iPhone 8375667
iPhoneSEiPhone SE320568
googlePixel2Google Pixel 2411731
googlePixel2XLGoogle Pixel 2 XL411823
androidAndroid360640
'iPadMini/9.7'iPad Mini / 9.7768974
'iPadPro10.5'iPad Pro 10.58341112
'iPadPro12.9'iPad Pro 12.910241366
surfacePro3Surface Pro 31440990
surfacePro4Surface Pro 41368912
desktopDesktop14401024
macbookMacbook1152700
macbookProMacbook Pro1440900
surfaceBookSurface Book15001000
iMaciMac1280720
appleWatch42mmApple Watch 42mm156195
appleWatch38mmApple Watch 38mm136170
a4A4595842
a5A5420595
a6A6297420
letterLetter612792
tabloidTabloid7921224
twitterPostTwitter Post1012506
twitterHeaderTwitter Header1500500
facebookPostFacebook Post1200630
facebookCoverFacebook Cover820312
instagramPostInstagram Post10801080
instagramStoryInstagram Story10801920
dribbbleShotDribbble Shot400300
dribbbleShotHDDribbble Shot HD800600
linkedInCoverLinkedIn Cover1584396

Example

<Frame name="List">
<Text>Hello world!</Text>
</Component>