Align Button content

1 Answer 122 Views
Button
Thomas
Top achievements
Rank 2
Iron
Thomas asked on 05 Oct 2022, 12:13 PM

Hi,

is there a way to align the content of a Button? The content seems to be always horizontally centered but I need it to be left/start aligned.

Best regard,
Thomas

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Vessy
Telerik team
answered on 06 Oct 2022, 12:52 PM

Hi, Thomas,

You can control the content alignment of the button by configuring the `justifyContent` style of the component:

      <Button
        themeColor={'primary'}
        style={{ width: 200, justifyContent: 'left' }}
      >

I have prepared a sample implementing the suggested approach, you can test it here:

https://stackblitz.com/edit/react-bmsefd?file=app%2Fmain.jsx

Regards,
Vessy
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Thomas
Top achievements
Rank 2
Iron
commented on 06 Oct 2022, 03:54 PM

Hi Vessy,

thank your very much. Works perfect.

Best regards,
Thomas

Vessy
Telerik team
commented on 07 Oct 2022, 05:29 AM

You are welcome, Thomas :)
Tags
Button
Asked by
Thomas
Top achievements
Rank 2
Iron
Answers by
Vessy
Telerik team
Share this question
or