The New Way to Build with AI! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Browse ReUI Pro

RTL Switching on runtime in Blazor


Hi,

I'm customizing the UI as per my requirements. Now, I want to change the LTR to RTL at runtime. I found that themesetting.json can do that switching. But It doesn't do on runtime. How can I make it? Please give me complete instructions for this problem.

It would be a great thing if you responded with this question.

Regards
Nabeeh T


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)

 
Deleted comment
Deleted comment

Hi,

Thank you for reaching out to us.

In themessetting.json you can set a default theme mode if you want to switch mode dynamically you should use KTTheme.SetDirection("RTL").

Please keep in mind, that this value will be overridden with value from config on page refresh to have the selected mode you need to store the user's selected mode in the cookies or your database and then inside Starterkit/_keenthemes/KTBootstrapBase.cs inside function initThemeDirection you can set saved value.

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Hello,

Thank You for your attention.

I already tried this by using KTTheme.SetDirection("RTL"). I'm little confused about changing the UI at runtime. It didn't trigger the initThemeDirection. What I want to do now!? I already said that am a Noobie in blazor. So, please reply with detailed answers with Attatchment if it is possible.

Regards,
Nabeeh T



Hi,

Sorry for the late reply.

The initThemeDirection is triggered on page refresh and by default it sets direction from theme configuration. You can reuse this function and when user changes direction you can write user's selected direction to the session and then set the direction from the session in this function.

Do you have any errors when you are using KTTheme.SetDirection?

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
buy metronic keenthemes mega bundle

ReUI

Open-source React components, blocks and templates built on shadcn/ui and Tailwind CSS by Keenthemes.