Is possible to get a parent rect transform to resize to fit its child text?

Is there a way to get this working with just unity components like content fitter or layout ?
the goal is to have a child text with its text changing length, so the parent (text background) would adapt its size ?

https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/HOWTO-UIFitContentSize.html

Fit to size of UI element with child Text

If you have a UI element, such as a Button, that has a background image and a child Game Object with a Text component on it, you probably want the whole UI element to fit the size of the text - maybe with some padding.

In order to do this, first add a Horizontal Layout Group to the UI element, then add a Content Size Fitter too. Set the Horizontal Fit, the Vertical Fit, or both to the Preferred setting. You can add and tweak padding using the padding property in the Horizontal Layout Group.

Why use a Horizontal Layout Group? Well, it could have been a Vertical Layout Group as well - as long as there is only a single child, they produce the same result.

̶t̶h̶i̶s̶ ̶d̶o̶e̶s̶ ̶n̶o̶t̶ ̶w̶o̶r̶k̶s̶.̶

it works. but do not forget to set both “control child size”. thanks

As you gain more experience with Layout Groups and Content Fitters you’ll see yourself when and which option is necessary