Hi Shopify team,
While reviewing the s-button
web component, I noticed there’s currently no way to make the button full width — similar to the fullWidth
prop available in the Polaris React Button
component.
Use case:
In many responsive layouts or form sections, especially on mobile devices, we often need buttons to span the full width of their parent container. This is easily achieved in Polaris React using the fullWidth
prop like this:
<Button fullWidth>Submit</Button>
However, in the web component version (s-button
), there doesn’t appear to be an equivalent. Here’s an example of what I tried:
<div style="width: 100%">
<s-button>Submit</s-button>
</div>
Even when wrapping the s-button
in a full-width container, the button itself doesn’t expand to fill it. I also tried applying styles directly:
<s-button style="width: 100%">Submit</s-button>
But this doesn’t behave consistently across different layouts and often gets overridden.
Is there a recommended way to achieve this in the current implementation? If not, could full-width support be added to maintain parity with Polaris React components?
Thanks in advance!