figma / code-connect

A tool for connecting your design system components in code with your design system in Figma
MIT License
843 stars 64 forks source link

Ways to use frame width/height in code connect props? #120

Open Chanki-Min opened 1 month ago

Chanki-Min commented 1 month ago

Please provide:

In our team, we use icon component like below. There's no component properties.

So we adjust icon width/height by Frame width and height

스크린샷 2024-08-08 23 53 35

In this situation. We are implementing code connect for this icon

import figma from '@figma/code-connect';
import React from 'react';

import { MonoIconStarSolid } from './MonoIconStarSolid';

figma.connect(
  MonoIconStarSolid,
  'https://figma.com/design/...',
  {
    props: {}, // how can we import frame width/height in hear?
    example: props => <BdsMonoIconStarSolid />,
  }
);

Are code connect has api for using frame width as props?

tomduncalf-figma commented 1 month ago

Hey @Chanki-Min, we don't provide access to design properties like width and height right now, only component properties. We're always looking to evolve Code Connect to support more use-cases though, so I'll mention your request to the team!

ZeVoidLX56 commented 1 week ago

I vote for this issue, I would like to get the name of the node and I suppose it's the same