Skip to content

Changing width of components #254

Closed Answered by falkoschindler
ChangPaul asked this question in Q&A
Discussion options

You must be logged in to vote

Sure. You can either use .style to define CSS for an element or set .classes to use Tailwind:

ui.input('Name') # for reference
ui.input('Street').style('width: 200px')
ui.input('City').classes('w-20')

This works for most UI elements, also for sliders:

ui.slider(min=0, max=100, step=1, value=50).style('width: 200px')
ui.slider(min=0, max=100, step=1, value=50).classes('w-20')

Using the full width of the parent element is possible with CSS or Tailwind:

ui.input('Street').style('width: 100%')
ui.input('City').classes('w-full')

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rodja
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #253 on January 17, 2023 20:53.