-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: multicolumn layout forms #214
Conversation
This is so awesome @adamdottv! We were thinking about adding different layouts and I think this is great. One thing we might want to do is make the API more "layout" based to allow swapping later on: For example: form.WithLayout(huh.LayoutColumns(2))
form.WithLayout(huh.LayoutGrid(2, 2))
form.WithLayout(huh.LayoutAuto) // would automatically layout the groups to fit the screen width
form.WithLayout(huh.LayoutStack) // vertically stack the groups (for tall and narrow terminals) Obviously don't need to add the other layouts now but want to make sure the API supports future expansion, what do you think? Also, the column layouts are so great, excited to get that in! Thank you for the awesome addition! |
ah, love it! will try to get these changes in over the weekend! |
alright @maaslalani, i reworked to use a |
i tried to implement |
This is so great @adamdottv! I'll try to review this shortly, we can totally merge this without needing We'll have to think about what happens when someone specifies something like a Form width of We'll need to make sure all the columns are evenly divided to fit within that width, and respect the form width, group widths, and field width (I wonder if we can leverage |
I have never seen a rounded font in a terminal before, @adamdottv. What typeface is this? |
it's gt maru mono! |
Fancy! I really never expected to see Grillitype and Open Source together (and yet it makes sense). |
fyi, i went ahead and added a |
That's so fantastic! Thank you so much, sorry for taking a while to get to this one. |
no worries at all! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking awesome, thanks so much @adamdotdev!
Merged in #274 |
over at @terminaldotshop we've got some
huh
forms used for payment and shipping info and they'd look a lot better in our app if they were spread over a couple of columns. this pr addsform.WithColumns(count)
and splits the groups over the defined columns.