Create a Button in Figma with Responsive Text, using Auto Layout.
If you are creating a button in Figma simply using a rectangle and text elements, the rectangle shape will need to be changed depending on the length of the text in the button. This is the hard way, there is an easier way.
Create a Button using Auto Layout to define the spacing/padding for the top, bottom, left and right. This will allow the button shape to expand or contract depending on the length of the text inside the auto layout, while keeping the design spacing that you have defined.