Repository navigation
1.12.0
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
AvatarGroupis removed.Stackdoes everything it did and is not about avatars. What is lost is its context —size,shape,variant,colorandelevationset once for the group. Set them on the avatars, or on aNebaProviderfor the two it covers.
Added
-
Stack— a pile of things laid over each other.directionruns it along the inline axis, down the page, or diagonally as a fanned deck;overlapanddropsay how far each item sits under the last;max,totalandoverflowturn the ones that did not fit into one more item at the back;scaleStepandopacityStepmake the pile recede;ringdraws 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 aclassName.<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.gridis a contact sheet;masonrykeeps each picture's own proportion and stacks the columns;justifiedkeeps the proportions and fills every row to the edge, which is the only arrangement where nothing is cropped and nothing is left over;quiltedis 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, andjustifiedis a wrapping flex row the browser does the arithmetic for.masonryis 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.columnstakes a breakpoint map andgapa step, a number or a length.captionputs an item's title and description below the picture, across the foot of it, or under the pointer;hoveranswers with depth, colour or the one scale the design language allows;previewopens 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,watermarkandprotectpass straight through to every tile'sImage, and the last two follow the picture into the viewer. Thegallerymessage namespace is new, in all eighteen languages. -
Show— its children at some widths and not at others.aboveis an inclusive floor andbelowan 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;useBreakpointalready could. The wrapper isdisplay: contents, so aShowbetween aGridContainerand aGridleaves 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 aGridContainerwith aGridaround each child.directiontakeshorizontal/verticalrather 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,rowSpacingandcolumnSpacingare aGridContainer's props on its scale, so a gutter is one number across the two. It draws nothing at all, andwrapis off by default. -
Six more
Animate*—AnimateReveal, an edge travelling across content that is already in place, as aclip-path, so nothing reflows and it is also atransitionvalue;AnimateFloat, a slow drift with nowhere to get to;AnimateShake, the one effect that says no, which defaults totrigger="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 withIntl.NumberFormatoptions 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 frominternal/text.ts. -
stagger,durationStepandreverseon the nineAnimate*whose motion is one@keyframeson the element itself. At0— 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.AnimateAppearruns 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 costsduration,delay,repeatand everytrigger, and falls back to running once on mount where the browser has noanimation-timeline. -
useBreakpointValueanduseCurrentBreakpoint— a breakpoint map read in JavaScript exactly as the cascade reads it, for a caller working out a number for themselves.undefinedis 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
Imagecould not do, none of which costs anything until it is asked for.filtercolours 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.frameis how the picture is mounted, a silhouette on its own or the whole arrangement ofcorner,border,mat,background,elevationandfeather; the line is an inset shadow on a layer over the picture rather than aborder, which is what lets it follow a chamfered corner and keeps it out of the layout.watermarkdraws a mark in a corner or tiled across the whole picture, as one SVG background rather than a wall of elements.protectturns 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. -
overflowandlinesonTabs—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.linescaps a wrapping bar at that many tab-rows. -
maxWidthtakes a length and a breakpoint map onContainer,HeaderandFooter, 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 tomax-width, so'60ch'and'min(90vw, 72rem)'need no escape hatch and a number is pixels. The ladder is namedNebaMeasurerather than left asNebaSize, because it shares five names withNebaBreakpointand only four of its five values. -
Statistic'svaluetakes a node, which is where anAnimateCounterbelongs.
Changed
-
The library's media queries are
theme(--breakpoint-*), so a Tailwind project moves Neba's widths by moving its own.@mediacannot 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-mdmoved your utilities and left Neba at 48rem in both places. A project onneba/styles.cssgets the widths baked in, since that sheet is compiled here. -
A
Togglethat is on now looks like it. Off wasaccent 8%and on wasaccent 10%— two names for one colour, with the ink carrying the whole state. Off leaves the colour family entirely now for the neutral--neba-panelladder, and on takes the dyed--n-panel-pressthat draws aSegmentedButton's chosen segment. A control with two states cannot spend the family on the one that is false. -
Home,End,PageUpandPageDownscroll aDataTableand 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 noheightormaxHeightleaves all four to the browser rather than taking them and turning them into nothing. -
A
Spoileris the same height covered and uncovered.reversiblegrew the box by a whole button row at the moment of the press, and the cover — anabsolute inset-0layer 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.maxHeightstays 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
ScrollAreaalready 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 aSidebarbelow its breakpoint is a drawer, so the same thing happened to every collapsed page shell. The panel travels ontranslatenow and the scrim behind it still fades. It runs on--neba-durationrather than the window ladder's 240ms, because--neba-duration-windowis not zeroed underprefers-reduced-motionand a drawer sliding across the screen is exactly what that setting is asking not to see. -
A
GaugeChartsweeps to its reading. It drew the reading as a wedge, and a wedge is a closed shape, so moving the value rewrote itsd— not a property CSS can travel along. It is a stroke along the middle of the groove now, whose drawn length isstroke-dashoffsetwithpathLength="1". The shape on screen is identical; onlyfillmoved tostroke. -
An
Imageweighs 6.5 kB instead of 23.4. ADialogwas most of what it cost, andpreview, the only thing that opens one, is off by default. It is fetched on demand now, the wayCodeBlockfetches a grammar. -
npm testruns the suite in sessions of at most fifty files, each its own browser, throughscripts/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 buildemptiesdist/first. It never did, andtsconly ever writes, so a component deleted fromsrc/stayed indist/and shipped. RemovingAvatarGroupis what surfaced it. -
ScrollZone'sbuttons="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/reactis on 1.8.0, which is the floordependenciesdeclares. 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 aCombobox's popup arrived in one frame while the calendar hanging off theDatePickerbeside them took 160ms. The fade was fourteen identical copies of one declaration; it ispopupFadeClassesininternal/styles.tsnow, read by sixteen surfaces, and the two that were missing it got it by being written the same way as the rest.NavigationMenukeeps its owntransition, 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.
transitionClasseslists the four properties a control answers a pointer with, andopacityis not one of them. AnImagecarried 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,BarChartandScatterChartnow read the sameseriesDimClassesthat onlyPieCharthad. -
A
Checkbox's tick and aRadio's dot appear over time. The tick draws itself along its own length onstroke-dashoffset, over a path normalised withpathLength="1"so one number covers both the tick and the indeterminate dash; the dot grows out of the centre of its ring onwidthandheight. 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
transitionshorthand. 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 throughrand a scatter's arbitrary<path>reaches throughscale. The scatter mark grows about the point it is pinned to rather than the middle of its bounding box. All three ridemarkTransitionClasses, 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 onwidth— the same width on the same element, so no glyph is scaled. ATabpanel'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. AnAvatar'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. AFloatingActionButton's dial no longer arrives in a single frame. -
A
TreeViewbranch opens at a height. It was there on one frame and gone on the next, whileAccordionandCollapsible, which do the same thing, both travel. It is a grid row going from0frto1fr, 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 markeddata-closing, which keeps its rows out of the order the arrow keys walk and deregisters them on the same render that shut the branch. -
Transfersays 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, becauserowsalso 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, so10,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>firesloadat 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 atopacity: 0behind its own placeholder for good. It is asked after the fact now:completesays whether it finished andnaturalWidthsays which way. -
A
Drawerininlinemode and a collapsedSidebardropped the props they were handed. Only theoverlayshape spread them, so anid, adata-*or anaria-*reached the panel in one mode and not the other — and on aSidebarthe 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.tscan 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
HowToStepsrow 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'saria-labelnow. Atitlethat 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 thespacingbeside it. The two are walked together now, andFlexuses the same fold. -
The suite finishes.
run-testhad been red onmainfor 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:buildneeded 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 V8Abort trap: 6inside 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
sizeandvariantare 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
translatewhere every other floating surface only fades.
Every release is in the changelog on the docs site and in CHANGELOG.md at this tag.