Catalogue / Plate 29← All plates
Tabs that trade height
Stacked tabs in a box of fixed height: one grows as the other shrinks, in 0.15 s.
Sampleton Observatory · tonight
A waxing crescent, setting soon after ten. Look low in the west just after dusk.
Open: The moon. Section heights now: settling px, always adding up to the same box. Up and down arrow keys move between tabs.
Remake it
Build one interactive web page: Sampleton Observatory, tonight: the moon, the planets, the comet and the stars. The four tabs sit in a box that never changes size. Choose one and it takes the height of the one before in 0.15 s, while its title goes from grey to near black in the same time. The open tab draws its sky in blocks. Up and down arrows move between them, and the readout prints the real heights. Set it on an invented business called Sampleton, with its own drawn or generated pictures and no one else's files. It suits: An FAQ, a set of services, a product's few facets; anywhere the page below should stay put while the content above swaps. Do not let it fail the way this kind of piece usually does: Content cut off by a fixed box, and a page that jumps. Here the box is sized by the viewport, each tab's text is short, the page below never moves, every tab is a real button with its state announced, and reduced motion removes the transition. It must work with the keyboard, on a phone, with reduced motion respected and no text under 12px. Tell me which libraries you chose and why.
Notes: when it suits, when it does not, how it fails
- When it suits
- An FAQ, a set of services, a product's few facets; anywhere the page below should stay put while the content above swaps.
- When it does not
- Long answers, since the box has a fixed height and the open tab can only use its share.
- How it fails
- Content cut off by a fixed box, and a page that jumps. Here the box is sized by the viewport, each tab's text is short, the page below never moves, every tab is a real button with its state announced, and reduced motion removes the transition.
Measured on: labs.google · Science. Built from scratch for an invented business; nothing here comes from the site studied.