Inverse accordion tab?

Hey y’all,

I’m trying to achieve the (attached) accordion/tab style.

The line at the bottom is the end of the section. Upon click, the div expands upwards.

What would be a good way to approach this in b?

Brainstorming the logic…

btn - clickable button
div - height 0
  onclick btn height auto if collapsed (vice versa if open)
  if some element has .active class, remove it, and apply it to the clicked element
  transition height 0.2

I’d want it to expand upwards though, and not push down the page…so would have to set it as position:absolute; bottom:0 perhaps?

I’m working on prototyping it, but any suggestions would be appreciated in the meantime.

Thanks

Why don’t you ask ChatGPT?

Would be interesting to see if the AI could generate the code…