Skip to content

1.12.0

Choose a tag to compare

@github-actions github-actions released this 29 Sep 01:48
· 909 commits to main since this release

The release about the things that were already there and were not quite saying it.

Most of it came out of asking one question of every component in turn: when a state turns over, does anything happen, or is the second state simply drawn? Twenty-odd answers were "simply drawn" — a toggle whose on and off were the same colour, a checkbox whose tick was there on one frame and gone on the next, a gauge that jumped to each new reading, a spoiler that moved the page when it opened. Three were fades that had been written down and never ran.

Four components are new. Stack is a pile of things laid over each other and replaces AvatarGroup; Gallery is a set of pictures in one of four arrangements; Show and Flex are the two answers a breakpoint gives directly. There are seventeen Animate* where there were eleven, and a stagger that turns any of the nine keyframe effects into a set of them.

The last group is the same complaint one level up. The library had a breakpoint system — five widths, a per-breakpoint map, a cascade that resolves it without React hearing about it — and it reached exactly two props on two components. There was no way to draw something at one width and not another, no way to say "a row here, a column there", no way to move the widths, and no page that wrote any of it down.

Where the bytes went

What you import 1.11.0 1.12.0
Button 5.1 kB 5.1 kB
Chip 3.2 kB 3.3 kB
LineChart 11.4 kB 11.6 kB
CodeBlock 5.0 kB 5.0 kB
Image 23.4 kB 6.5 kB
Gallery — 10.2 kB
a whole page shell 28.5 kB 29.0 kB
12 components — a typical app 68.2 kB 70.5 kB
12 components, with Korean 70.7 kB 72.9 kB
25 components — a large one 112.6 kB 115.7 kB
all exports 248.1 kB 263.9 kB

Image is the row that moved on purpose, and it is a new row because nothing had ever measured it: a Dialog nobody had opened was 20 kB of it. Chip is the one worth explaining, because it is the only one that moved for a reason other than "there is more library now" — transition gained a seventh effect, and the entrance vocabulary is two Records that an object literal cannot tree-shake per key, so every component offering a transition pays 0.1 kB for the row whether or not it names it. AnimateFloat and AnimateShake bring their own keyframe class instead of a row in that table, which is why it is only 0.1 kB.

all exports went up rather than down because npm run size learned to count honestly while this was being measured. It called every chunk but the entry deferred, which stopped being true the moment a module was imported both statically and dynamically. It walks the static import graph now, so a number in the table is what a page needs before it draws.

The rest of the movement is one dependency. @base-ui/react is on 1.8.0, and pinning it back to 1.7.0 returns every row to the figure this table carried before it — so the 1.4 kB on a twelve-component app and the 2.5 kB on all exports are its rather than ours. Nothing that draws a single component moved by more than 0.1 kB.

Breaking changes

  • AvatarGroup is removed. Stack does everything it did and is not about avatars. What is lost is its context — size, shape, variant, color and elevation set once for the group. Set them on the avatars, or on a NebaProvider for the two it covers.

Added

  • Stack — a pile of things laid over each other. direction runs it along the inline axis, down the page, or diagonally as a fanned deck; overlap and drop say how far each item sits under the last; max, total and overflow turn the ones that did not fit into one more item at the back; scaleStep and opacityStep make the pile recede; ring draws the hairline that stops two overlapping shapes of similar tone reading as one smeared one.

    The overlap is a margin rather than a translate, so the box is exactly as big as what is in it and the content after a Stack is laid out against the right width. Each item is drawn into a wrapper of its own rather than cloned onto, because a Tooltip around an avatar is under no obligation to accept a className.

    <Stack ring max={3} total={12} overflow={(hidden) => <Avatar initials={`+${hidden}`} />}>
      {team.map((name) => (
        <Avatar key={name} name={name} />
      ))}
    </Stack>
  • Gallery — a set of pictures, and the arrangement is a prop rather than four components. grid is a contact sheet; masonry keeps each picture's own proportion and stacks the columns; justified keeps the proportions and fills every row to the edge, which is the only arrangement where nothing is cropped and nothing is left over; quilted is a grid whose tiles may take more than one cell.

    None of them measures anything. A tile's shape is the item's own ratio, so the wall is right in the first frame the browser paints and does not move again as the files land, and justified is a wrapping flex row the browser does the arithmetic for. masonry is the one layout that needs a number in JavaScript, and it deals each item into the shortest column rather than filling the first one top to bottom.

    columns takes a breakpoint map and gap a step, a number or a length. caption puts an item's title and description below the picture, across the foot of it, or under the pointer; hover answers with depth, colour or the one scale the design language allows; preview opens the picture full size with the rest of the set on the arrow keys, in a chunk that is not fetched at all unless the prop is on. filter, frame, watermark and protect pass straight through to every tile's Image, and the last two follow the picture into the viewer. The gallery message namespace is new, in all eighteen languages.

  • Show — its children at some widths and not at others. above is an inclusive floor and below an exclusive ceiling, so the same breakpoint in both covers every width exactly once, and the two together bound a range.

    <Show above="md">
      <Sidebar />
    </Show>
    <Show below="md">
      <SidebarTrigger />
    </Show>

    The children are always rendered and what changes is display, which is what makes the answer right in the first frame, the same on a server, and free on a resize. What it deliberately cannot do is stop something running; useBreakpoint already could. The wrapper is display: contents, so a Show between a GridContainer and a Grid leaves the cell a cell.

  • Flex — a row that becomes a column. "Side by side on a desktop, stacked on a phone" is half of what a responsive layout is, and the only way to say it was a GridContainer with a Grid around each child. direction takes horizontal/vertical rather than CSS's four values, so a Flex and a Stack say the same thing the same way, and it takes a breakpoint map — direction={{ xs: 'vertical', md: 'horizontal' }}. spacing, rowSpacing and columnSpacing are a GridContainer's props on its scale, so a gutter is one number across the two. It draws nothing at all, and wrap is off by default.

  • Six more Animate* — AnimateReveal, an edge travelling across content that is already in place, as a clip-path, so nothing reflows and it is also a transition value; AnimateFloat, a slow drift with nowhere to get to; AnimateShake, the one effect that says no, which defaults to trigger="manual" and is the single documented exception to the rule that a control is never transformed; AnimateSplit, a line arriving a word or a letter at a time; AnimateCounter, a number counted up to its value and formatted with Intl.NumberFormat options on every frame; AnimateScramble, text resolving out of noise in a box that is the finished length from the first frame.

    The three that animate text put the whole string in the document once for a screen reader and hide the performance from it, which is AnimateTyping's arrangement, and all four now take their grapheme boundaries from internal/text.ts.

  • stagger, durationStep and reverse on the nine Animate* whose motion is one @keyframes on the element itself. At 0 — the default — the box animates and the children are left alone, which is what they always did. Above it the effect moves onto each child in turn and nothing is written on the box, because a box fading in over eight children fading in is the same content faded twice. AnimateAppear runs on the same helper now, which is what stops the library having two staggers.

  • timeline="view" — any of the nine keyframe effects driven by how far the element has travelled through the viewport instead of by the clock. It is two declarations behind an @supports. It costs duration, delay, repeat and every trigger, and falls back to running once on mount where the browser has no animation-timeline.

  • useBreakpointValue and useCurrentBreakpoint — a breakpoint map read in JavaScript exactly as the cascade reads it, for a caller working out a number for themselves. undefined is a real answer: a map that has said nothing yet at this width is an opinion declined, which is what the CSS fallback says there too.

  • Four things an Image could not do, none of which costs anything until it is asked for. filter colours the picture — grayscale, sepia, invert, saturate, mute, contrast, or a CSS chain of your own — and rides the same transition as the picture's own fade. frame is how the picture is mounted, a silhouette on its own or the whole arrangement of corner, border, mat, background, elevation and feather; the line is an inset shadow on a layer over the picture rather than a border, which is what lets it follow a chamfered corner and keeps it out of the layout. watermark draws a mark in a corner or tiled across the whole picture, as one SVG background rather than a wall of elements. protect turns off the right-click menu, the drag, the iOS long press and the selection — a deterrent and not a lock, and the docs say so where the prop is described.

  • overflow and lines on Tabs — overflow="wrap" is for a bar whose tabs all have to be visible at once, and the rule under the chosen tab moves onto the line that tab is on rather than staying at the bottom of the list. lines caps a wrapping bar at that many tab-rows.

  • maxWidth takes a length and a breakpoint map on Container, Header and Footer, which had a copy each of the measure ladder and could only ever be one of its five values at one width. Anything that is not a step of the ladder goes straight to max-width, so '60ch' and 'min(90vw, 72rem)' need no escape hatch and a number is pixels. The ladder is named NebaMeasure rather than left as NebaSize, because it shares five names with NebaBreakpoint and only four of its five values.

  • Statistic's value takes a node, which is where an AnimateCounter belongs.

Changed

  • The library's media queries are theme(--breakpoint-*), so a Tailwind project moves Neba's widths by moving its own. @media cannot read a custom property, so a breakpoint stays a build-time decision and no provider prop could ever move one — but it can be a decision you take part in.

    @import 'tailwindcss';
    @import 'neba/tailwind.css';
    
    @theme {
      --breakpoint-md: 50rem;
    }

    That moves the library's own rules, the md: variants its components spell out, and its JavaScript, which reads the resolved widths back off the document rather than holding a second copy. Before this, redeclaring --breakpoint-md moved your utilities and left Neba at 48rem in both places. A project on neba/styles.css gets the widths baked in, since that sheet is compiled here.

  • A Toggle that is on now looks like it. Off was accent 8% and on was accent 10% — two names for one colour, with the ink carrying the whole state. Off leaves the colour family entirely now for the neutral --neba-panel ladder, and on takes the dyed --n-panel-press that draws a SegmentedButton's chosen segment. A control with two states cannot spend the family on the one that is false.

  • Home, End, PageUp and PageDown scroll a DataTable and nothing else. They used to move the selection with them, so ticking a row and then looking at the bottom of a thousand threw the tick away on the journey. The arrows still move and choose. A table with no height or maxHeight leaves all four to the browser rather than taking them and turning them into nothing.

  • A Spoiler is the same height covered and uncovered. reversible grew the box by a whole button row at the moment of the press, and the cover — an absolute inset-0 layer contributing no height — lost its own reveal button off the bottom edge whenever it was taller than what it covered. The row is drawn from the start and kept out of sight, and the cover is a grid item spanning every row that keeps its row on the press, giving up only the paint and the tab stop. maxHeight stays the deliberate exception, since releasing the clamp is the whole point of it.

  • A tab bar says when it has more bar. It already scrolled; the scrollbar is an overlay on macOS and furniture on Windows, so it is hidden on both and the ends fade instead, through the same two masks ScrollArea already uses.

  • A drawer comes in from its edge. It faded, which moves nothing and throws away the only thing that distinguishes it from a Dialog — and a Sidebar below its breakpoint is a drawer, so the same thing happened to every collapsed page shell. The panel travels on translate now and the scrim behind it still fades. It runs on --neba-duration rather than the window ladder's 240ms, because --neba-duration-window is not zeroed under prefers-reduced-motion and a drawer sliding across the screen is exactly what that setting is asking not to see.

  • A GaugeChart sweeps to its reading. It drew the reading as a wedge, and a wedge is a closed shape, so moving the value rewrote its d — not a property CSS can travel along. It is a stroke along the middle of the groove now, whose drawn length is stroke-dashoffset with pathLength="1". The shape on screen is identical; only fill moved to stroke.

  • An Image weighs 6.5 kB instead of 23.4. A Dialog was most of what it cost, and preview, the only thing that opens one, is off by default. It is fetched on demand now, the way CodeBlock fetches a grammar.

  • npm test runs the suite in sessions of at most fifty files, each its own browser, through scripts/run-tests.mjs — ceil(files / 50), so adding tests does not need the number touched. Nothing is skipped and nothing is retried: a failing test still fails its shard and still fails the run.

  • npm run build empties dist/ first. It never did, and tsc only ever writes, so a component deleted from src/ stayed in dist/ and shipped. Removing AvatarGroup is what surfaced it.

  • ScrollZone's buttons="auto" disables an inline button that has nowhere to go rather than hiding it. The lane is held open either way, so an emptied one was not a lighter row — it was the same row reading as stray padding at the leading edge, which is the state every reader meets first.

  • @base-ui/react is on 1.8.0, which is the floor dependencies declares. It is the only runtime dependency that moved, and the multi-component rows of the table above are where it shows.

Fixed

  • A Select's and a Combobox's popup arrived in one frame while the calendar hanging off the DatePicker beside them took 160ms. The fade was fourteen identical copies of one declaration; it is popupFadeClasses in internal/styles.ts now, read by sixteen surfaces, and the two that were missing it got it by being written the same way as the rest. NavigationMenu keeps its own transition, because its panel also changes size and a second shorthand beside its own would win or lose by stylesheet order.

  • Three fades were written down and never ran. transitionClasses lists the four properties a control answers a pointer with, and opacity is not one of them. An Image carried a comment saying the picture is faded in over a transition that could not fade it; a chart's legend dimming switched rather than faded; and a chart's other series dropped to 0.28 the frame the pointer crossed a legend row. LineChart, AreaChart, BarChart and ScatterChart now read the same seriesDimClasses that only PieChart had.

  • A Checkbox's tick and a Radio's dot appear over time. The tick draws itself along its own length on stroke-dashoffset, over a path normalised with pathLength="1" so one number covers both the tick and the indeterminate dash; the dot grows out of the centre of its ring on width and height. Neither scales, and the design language now names the four things allowed to travel inside a control — a Switch's thumb, a Checkbox's tick, a Radio's dot, a Rating's fill — and says the list is closed.

  • A chart's marks answer the pointer on one transition shorthand. A whole series at 0.28 and a single datum at 0.92 are the same sentence at two scales, and the datum half snapped everywhere the series half now fades; the mark under the crosshair also grows by a pixel, which a <circle> reaches through r and a scatter's arbitrary <path> reaches through scale. The scatter mark grows about the point it is pinned to rather than the middle of its bounding box. All three ride markTransitionClasses, because two shorthands on one element are decided by stylesheet order rather than by intent.

  • Four more places where something changed and nothing moved. A Rating's fill travels on width — the same width on the same element, so no glyph is scaled. A Tab panel's arriving content fades up, and only the arriving one, since fading a leaving panel would put both in the layout and make the sheet twice as tall on the way past. An Avatar's picture fades up on its own clock instead of swapping in on one frame, which on a list of forty was forty separate flickers. A FloatingActionButton's dial no longer arrives in a single frame.

  • A TreeView branch opens at a height. It was there on one frame and gone on the next, while Accordion and Collapsible, which do the same thing, both travel. It is a grid row going from 0fr to 1fr, so nothing is measured and a nested branch is carried by the same track. A branch on its way shut stays in the document but is marked data-closing, which keeps its rows out of the order the arrow keys walk and deregisters them on the same render that shut the branch.

  • Transfer says where the rows went. A press on the arrow took three rows off one list and put them in the other in a single frame, so the only way to find them was to read the whole panel again. The rows that landed fade up — keyed on the press and not on the list changing, because rows also changes on every keystroke in the search box and a filter that animates is a filter that feels slow.

  • A GaugeChart's reading and range labels stay inside the dial. The reading was twice the tick type whatever it said, so 10,000% was written straight across the band and out of the card; it is solved against a chord of the inner circle now and gives way to once the tick type before it is left to run. The two range labels were written from the arc's mid radius and lay over the band on a thick dial; they are set from the outer edge, in the arrangement the end calls for, and a dial closed past 330° writes none. The dial is also centred in the box rather than pinned under its top margin.

  • A picture that had already decoded stayed invisible. An <img> fires load at whoever is listening at the time, and a data URI decodes inside the same task the element was inserted in — so the event went out before React had attached anything to catch it and the picture sat at opacity: 0 behind its own placeholder for good. It is asked after the fact now: complete says whether it finished and naturalWidth says which way.

  • A Drawer in inline mode and a collapsed Sidebar dropped the props they were handed. Only the overlay shape spread them, so an id, a data-* or an aria-* reached the panel in one mode and not the other — and on a Sidebar the mode is the window's choice rather than the caller's, so an attribute was there on the screen you developed against and gone on the screen you did not. A structural rule for this was tried and rejected: resolution.test.ts can ask whether one element both spreads and writes an attribute of its own, but "every tree this component can return forwards what it was handed" is a question about branches, and every regex shape of it produced false positives. It is three ordinary tests instead.

  • A HowToSteps row said its title twice. The sentence naming the step sat in a visually hidden line beside the title rather than in place of it, so a screen reader announced the button as "Use it Step 3: Use it". It is the button's aria-label now. A title that is a node leaves no string to build that sentence out of, and such a row is read as its contents.

  • GridContainer's axis gutters took their prop whole. spacing={2} columnSpacing={{ md: 6 }} left the row with no column gutter at all below 48rem, because the map says nothing there and the baseline it fell back to was the prop's own default rather than the spacing beside it. The two are walked together now, and Flex uses the same fold.

  • The suite finishes. run-test had been red on main for weeks, always the same way: the chromium jobs failed on every runner while firefox and webkit passed on all three. It is not a test — every test that starts passes, and chromium loses the browser somewhere past the hundredth file of a hundred and forty-six, so the file count comes up short beside a full test count. Twelve full runs, none finished; the only lever that separated a run which finished from one which did not was how many files a single browser session was asked to hold. See the sharding above; eighteen sharded runs since, all green.

  • npm run docs:build needed more heap than Node gives by default. A hundred and thirty-nine pages with two hundred React demos behind them is past 4.3 GB, and it failed as a V8 Abort trap: 6 inside Rollup that named no page at all.

Documentation

  • A new breakpoints page, which is where the rule that every entry is a floor, the table of which props are responsive, and the reason size and variant are not among them all live.

  • The design language names its two exceptions rather than leaving them to be found: the closed list of four indicators allowed to travel inside a control, and the drawer that arrives on translate where every other floating surface only fades.


Every release is in the changelog on the docs site and in CHANGELOG.md at this tag.