Variant box sizing

hello
i created a variant of a component. the text of the variant is not the same with the text of the component. i can’t change the dimensions of the variant. it still keeps the main component’s dimensions. is there a way to fix it? (when i change the dimensions, those of the variant change as well)
image
thank you.

You can try two ways:

  1. Set the component and the variants’ frame to auto-layout and use Hug for the horizontal resizing so they always follow the size of their contents.
    image

  2. Control+click and drag the boundaries (purple rectangle around the variant) to resize them manually. https://help.figma.com/hc/en-us/articles/360041539473-Frames-in-Figma#01H8CWAD9EZ3HBZ7G6N6GQCJ78

thank you very much. it helped me a lot.