How to change the button size in checkout extension?

Solved

How to change the button size in checkout extension?

ndt_ts
Shopify Partner
27 3 7

I want to alter the button size of the button component in checkout extension?

https://shopify.dev/docs/api/checkout-ui-extensions/2023-07/components/actions/button

Is there any way to accomplish it?

Also is there any way to open a link on click of that button?

Accepted Solution (1)

Liam
Community Manager
3108 341 879

This is an accepted solution.

Hi Ndt_ts,

 

You can't alter the size of the checkout buttons, this is an intentional decision to maintain the layout and style of the Shopify checkout. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 3 (3)

Liam
Community Manager
3108 341 879

This is an accepted solution.

Hi Ndt_ts,

 

You can't alter the size of the checkout buttons, this is an intentional decision to maintain the layout and style of the Shopify checkout. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

ndt_ts
Shopify Partner
27 3 7

Hi Liam,

is it possible to know if checkout extension is being shown on a mobile or desktop? i would like to show a different ui on mobile.

also is it possible to know the device resolution inside checkout extension? because most of the mobile screens falls under default styling of style helper, so my ui looks bad on many mobile screens..

any insights pls..!!!!

 

bluetree
Shopify Partner
1 0 0

How about alternate use InlineLayout ?

That way, you can create a full width button. You can then adjust the width using the columns property.

<InlineLayout columns={["fill"]}>
    <Button>text</Button>
</InlineLayout>

 

bluetree_0-1725582830528.png