React Figma Versions Save

⚛️ A React renderer for Figma

v0.24.0

2 years ago

An example:

<Page name="New page" style={{ backgroundColor: '#ff0000' }}>
    <View>
        <View style={{ width: 200, height: 100, backgroundColor: '#ffffff' }} />
    </View>
</Page>

v0.23.0

2 years ago

Add useStyleByKey hook which allows one to pass in specific textStyleId, fillStyleId, etc.

        const ViewComponent = () => {
            const fillStyle = useStyleByKey('testStyleId');
            return (
                <View
                    style={{
                        fillStyleId: fillStyle && fillStyle.id
                    }}
                />
            );
        };
        const TextComponent = () => {
            const textStyle = useStyleByKey('testStyleId');
            return (
                <Text
                    style={{
                        textStyleId: textStyle && textStyle.id
                    }}
                />
            );
        };

v0.22.0

2 years ago

Added useEffectStyle new props

Args Type Default Note
style.blurType LAYER_BLUR or BACKGROUND_BLUR LAYER_BLUR Type of blur effect
style.blurRadius number 0 Blur radius. Must be >= 0

v0.21.0

2 years ago

The useEffectStyle hook creates (or updates) EffectStyle and returns an object that contains effectStyleId and can be consumed in style prop.

Args Type Default Note
style Style Object The style will applied to a local style
style.shadowType DROP_SHADOW or INNER_SHADOW DROP_SHADOW Type of shadow effect
style.shadowSpread number 0 Shadow expansion distance
params Object
params.id String A style id
params.name String A style name
params.description String A style description

v0.17.0

2 years ago
  • Text component got hyperlink prop supporting.
  • All components over Figma Nodes go onNodeId callback supporting. onNodeId returns Figma Node ID.

An example:

<View>                                                                                 
    <Text                                                                              
        style={{ color: '#308eff', marginBottom: 50 }}                                 
        hyperlink={{                                                                   
            type: 'URL',                                                               
            value: 'https://react-figma.dev/'                                          
        }}>                                                                            
        React Figma website                                                            
    </Text>                                                                            
    {nodeId && (                                                                       
        <Text                                                                          
            style={{ color: '#308eff', marginBottom: 50 }}                             
            hyperlink={{                                                               
                type: 'NODE',                                                          
                value: nodeId                                                          
            }}>                                                                        
            Rectangle link                                                             
        </Text>                                                                        
    )}                                                                                 
    <View onNodeId={setNodeId}>                                                        
        <View style={{ width: 200, height: 100, backgroundColor: '#dd55aa' }} />       
    </View>                                                                            
</View>                                                                                

v0.16.0

2 years ago

Example:


<View
  style={{
    shadows: [{
      shadowColor: 'rgba(0, 0, 0, 0.2)', shadowRadius: 1
    }, {
      shadowColor: 'rgba(0, 0, 0, 0.3)', shadowRadius: 2 
    }]
  }}
/>

v0.15.0

2 years ago

A new prop has added in the Instance component:

detach: boolean;

When detach=true an instance detached through detachInstance method.

Thanks, @n0ruSh!

v0.14.0

2 years ago

Component and ComponentSet got publishable props supporting:

Prop Type Default Note
description String '' The annotation entered by the user for this component
documentationLinks ReadonlyArray<DocumentationLink> [] The documentation links for this component

Introduced in the Figma API Version 1, Update 23

v0.13.0

3 years ago

v0.12.0

3 years ago