Auto height for components based on text content

Hi! I want to build a stateful component whose height automatically adjusts based on a text box inside it (the text is dynamic/user-set and can wrap to multiple lines).

The goal: animate the component once at the source level, so every instance inherits that animation automatically. Then I want to place several instances together in a parent artboard, each with its own text, and keep even, consistent padding between them - regardless of how long each instance's text is.

Is that possible? How would you approach it?

Thanks!