S
S
Stepan Voevodin2020-09-18 12:42:24
Design
Stepan Voevodin, 2020-09-18 12:42:24

How to make a component in Figma with autofit height and resizable width?

There is a component
5f648029ed4b8876497882.png

I want:
1. To be able to change the width
2. To change the height relative to the text
3. So that the text takes the place of the cut out
5f6480f96302c003086856.png

element
. It's just that Figma doesn't have that ability.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Figma-designer, 2020-09-21
@Figma-designer

I can advise you to use Auto Layout, in which you place text and elements.
In this case, set the text width as Fixed Size, and then the width of the entire component will depend on the text.
It's a bit of a crutch, but I think +- is what you need. Because Figma does not yet know how to simulate the width of "100%"

S
sashabeep, 2020-09-21
@sashabeep

The simplest = for blocks that have their icon and closure disabled, remove autoLayout. or make 3 variants of the component - no left icon, no close button, and only text

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question