FROM CACHE - en_header

How to change the width of TextField

Jo27
Tourist
6 0 4

Hi there,

I'm using a Polaris <TextField> in my code. It defaults to full width though. Is there a way to change the width? An example is this screenshot, where the Textfield is not full width. So it can be done, but how? textfield.PNG

Replies 4 (4)
Jayvin
Shopify Partner
284 42 85

Hi,

You have to write some custom css for that textbox for in app. As far as I know, Polaris TextField does not have any width setting.

michaeltheodore
Explorer
59 6 9

What is your code for the input field?

jackcylin
Shopify Partner
17 2 6

The only way I know is to wrap in Stack with alignment fill to extend the whole width.

 

<Stack alignment="fill" vertical={true}>
       <TextField
          ...
       />
</Stack>

 

 

Zworthkey
Shopify Partner
5581 642 1508

hii, @Jo27 
Kindly share your store URL so,
I can solve your issue.
Thank You.