Skip to main content
Samantha_Fraser
September 20, 2023
Question

maxWidth Property?

  • September 20, 2023
  • 7 replies
  • 462 views

I see this specific version (Version 1, Update 69 | Plugin API) has a change I want to use - maxWidth on Text or AutoLayout. However, I can’t find a way to update my plugin to this version so that I can use this style property. Any suggestions?

I’ve tried implementing (multiple ways) in my current code and keep getting the error “Property does not exist in IntrinsicAttributes & AutoLayoutProps”.

Any ideas/advice?

This topic has been closed for replies.

7 replies

tank666
September 20, 2023

It’s not clear from your description whether you’re using the Plugin API or the Widget API because you’re referring to both. Where are you seeing this error: in the Figma Desktop app console or in your IDE?

Unfortunately, there is still not enough information. What ways have you tried? Have you updated your typing files? What is the structure of the node that you want to change the property on? What node is this? Is this node an auto layout frame? If it’s not an auto layout frame, is it nested within an auto layout frame?

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
Samantha_Fraser
September 20, 2023

I’m seeing the error in my IDE.

I’ve tried adding the maxWidth to:

  • Autolayout (various levels of frames and nesting - top to bottom)
  • Text w/in an Autolayout

I’d like to have the maxWidth applied to that widget.Text name=“ActText” in conjunction with the width={“hug-contents”}, which I can do in Figma itself, but seem unable to translate to the code.

Samantha_Fraser
September 20, 2023

The error

Manuel_Carrera
September 20, 2023

I think we’re trying to use the widget api!

Manuel_Carrera
September 20, 2023

We’re trying to build a plugin and using the widget API. When using the Text component, it seems we can’t use the maxWidth prop on it. We’re tried updating both widget and plugin api in our package.json file to 1.77.0 and 1.8.0 respectively

Manuel_Carrera
September 20, 2023

Apologies, i meant we’re building a widget* not a plugin

James_Yang
Figmate
Figmate
September 21, 2023

Thanks for bringing this up. I’ve reported this issue internally.