This is a migrated thread and some comments may be shown as answers.

Align ToolbarItems to the right of the toolbar

5 Answers 444 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vinod
Top achievements
Rank 1
Vinod asked on 05 Sep 2019, 11:33 AM

Hi,

How to align ToolbarItems to the right of the toolbar ? I have created an example below that could be used for reference..

https://stackblitz.com/edit/react-pns7jw-afbddf?file=app/main.jsx

 

Regards,

Vinod

5 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 09 Sep 2019, 06:04 AM

Hello,

Thank you for the example.

This can be done using the dir property of the Toolbar:

https://www.telerik.com/kendo-react-ui/components/buttons/api/ToolbarProps/#toc-dir

I have modified example as well:

https://stackblitz.com/edit/react-pns7jw-uts31s?file=app/main.jsx

Regards,
Stefan
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Vinod
Top achievements
Rank 1
answered on 09 Sep 2019, 07:21 AM

Hi Stefan,

I only want the controls on the Toolbar to move to the right. But in the answer provided, it seems it changes the entire direction of the control which is not the intention. Please observe in the screenshot below that the dropdown arrow has shifted to left along with scrollbar which signifies that the direction of the control itself has changed. Could you provide an improved solution ?

Regards,

Vinod 

 

0
Stefan
Telerik team
answered on 10 Sep 2019, 05:30 AM

Hello,

Thank you for the clarification.

I can suggest setting the following CSS to the Toolbar:

https://stackblitz.com/edit/react-pns7jw-ojtxef?file=app/main.jsx

It will also reverse the other of the items, but as the order is part of the declaration, they can just be declared in the opposite one.

Regards,
Stefan
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Vinod
Top achievements
Rank 1
answered on 10 Sep 2019, 03:35 PM

Stefan, 

What if I don't want to right align all the items on the toolbar but only some of them. In the example above, could you please show how do you display the Switch on the right on ToolBar ?

Regards,

Vinod

0
Nikolay
Telerik team
answered on 12 Sep 2019, 11:07 AM
Hi,

The Toolbar and ToolbarItem components have className prop. You can use them and style the components as you like.

About the positioning of the ToolbarItems, you can apply position relative style to the Toolbar and position absolute with left and right values to each ToolbarItem (https://developer.mozilla.org/en-US/docs/Web/CSS/position).

Regards,
Nikolay
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Vinod
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Vinod
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or