Repository navigation
1.11.0
The release that closes the gaps, rather than the one that adds a shelf of new components.
It started as an audit against the libraries people arrive here from — MUI, Ant Design, Chakra, Mantine, Radix, PrimeReact — and the answer was not the component list. Neba already ships charts, animations, a page shell and a data table that most of them charge for or split into a second package. What it was missing was smaller and felt harder: no way to say "this application is compact" once, no hooks, no imperative confirm, no standalone calendar, and a TextField you could hand an onKeyDown but could not actually make act on a key.
Nine of those are closed here. The one deliberately left open is a rich text editor, which is somebody else's package.
Where the bytes went
| What you import | 1.10.0 | 1.11.0 |
|---|---|---|
Divider |
3.0 kB | 3.2 kB |
Button |
5.0 kB | 5.1 kB |
Chip |
3.0 kB | 3.2 kB |
LineChart |
11.3 kB | 11.4 kB |
CodeBlock |
4.9 kB | 5.0 kB |
| a whole page shell | 28.4 kB | 28.5 kB |
| 12 components — a typical app | 67.3 kB | 68.2 kB |
| 12 components, with Korean | 69.9 kB | 70.7 kB |
| 25 components — a large one | 111.7 kB | 112.6 kB |
| all exports | 240.7 kB | 248.1 kB |
Every component grew by about 0.2 kB, and it is one thing. NebaProvider fills in the props a call site left out, which means every component that takes size, density, variant or locale now reads a context before its own destructuring — a hundred and thirty of them. internal/defaults.ts is 0.2 kB gzipped and it is a fixed cost even on a page that has no provider, which on a Chip is five per cent. It is stated here rather than left to be found, and CLAUDE.md now carries it as the sixth thing that holds the bundle numbers in place: whatever goes into that module goes into all of them.
The rest of the growth is the four new components and the hooks, and it lands where it should — on all exports and nowhere else.
neba/styles.css moved 20.8 → 21.0 kB gzipped.
A DatePicker has always drawn all three grids. The month name opened twelve months, the year opened twelve years, and both were only ever a way of reaching a day — so a product that wanted a billing period or a tax year got a control that showed it the twelve months and then insisted on a date inside one of them. granularity makes one of those grids the answer.
And a field has always accepted an onKeyDown, which is not the same as being able to act on a key. On a Combobox the keys worth acting on are the list's and never arrive; on a NumberField the handler lands on the column holding the label rather than on the <input>. shortcuts is { 'Mod+Enter': send } bound to the control itself, written in the vocabulary Shortcut already draws — which turned out to be a vocabulary the library only half spoke.
internal/keys.ts is 0.6 kB of the field rows above, and it is carried whether or not a shortcuts map was passed: the alias table and the predicate are reached from the control's own key handler, so there is nothing for a bundler to drop.
Added
-
granularityonDatePicker—'day'(the default, unchanged),'month'or'year'. At the two coarser settings the calendar opens on that grid and a click there is the answer; there is no day view to fall into. Climbing is untouched, so a month picker still reaches any month of any year in two clicks.The value stays a
Date, normalised to the first day of what was chosen — 1 March, 1 January. A second value type would have meant a second set of props to compare it with, andminDate/maxDatealready speakDate.Four things follow the unit rather than being left to the caller to keep in step. The trigger's default
formatbecomes{ year: 'numeric', month: 'long' }or{ year: 'numeric' }—dateStyle: 'medium'on a month picker printsMar 1, 2026, which names a day nobody chose in the one place a reader actually looks. The footer's shortcut says "This month" or "This year".namesubmitsYYYY-MMorYYYY, the shape a native<input type="month">already submits, rather than a day the server would have to know to ignore. And the bounds are read at the unit. -
thisMonthandthisYearonPickerLabels— the two strings that footer needs. Both have English defaults, like the eighteen already there. -
shortcutsonTextField,NumberFieldandCombobox— a map from a key combination to what it does, spelled the wayShortcutdraws it, so the key a form shows a reader and the key it binds are one string.<TextField label="Message" multiline shortcuts={{ 'Mod+Enter': (event) => { event.preventDefault(); send(); }, Escape: clear }} />
A map rather than an
onShortcut(combination, event), because a caller with three shortcuts wants three functions and not aswitch. Modifiers are matched exactly, soEnterandMod+Enterare two entries that never both fire and no entry is ambiguous.It is bound to the control, which is the half
onKeyDowncould not do. On aTextFieldthat only movescurrentTargetonto the<input>; on aNumberFieldit is the difference between the field and the column the label sits in; on aComboboxit is the only way in at all, because the arrows,EscapeandEnterbelong to the list and are gone before anything on the root sees them.onKeyDownstill receives every keystroke and runs after the map — neither prop replaces the other, and nothing is prevented on your behalf.This is deliberately three components and not thirteen. It is for a control a reader types into, where a key is a thing the control already has an opinion about. Everything else already takes the handler it needs.
-
NebaShortcutsinsrc/types.ts— the type behind that prop, generic in the element soevent.currentTarget.valueis typed without a cast. -
NebaProvider— one optional place to set what every component under it starts from, and the gap that costs the most on every project while showing up in no bundle number.defaultsfills insize,density,variantandlocalewhere a call site left them out, and the call site still wins: caller, then provider, then the component's own literal. The list is closed.coloris out because a component's colour default is often semantic — an Alert isinfo, a Popconfirm isdanger— and one global override would repaint those into something that means something else;elevationis out because a shadow is opt-in per surface, and an application-wide one is the moulded-plastic look the design language is against.The colour scheme writes
data-themeandcolor-schemeon<html>; the second is what turns the browser's own scrollbars and form controls over, and a page that changes only its own colours keeps a white scrollbar down the side of a dark one.useColorScheme()keepssystemas its own answer andresolvedColorSchemenever is, because a three-way switch has to showsystemas a position rather than as whichever of the two it resolves to.colorSchemeScript()is exported for the first-paint flash React cannot prevent, and shares the provider's key and attribute rather than being a snippet in a page nobody updates.directionsetsdirand wraps Base UI'sDirectionProvider, and is left alone when not given, so a document that already sets it server-side is not fought over. -
Seven hooks, from
neba/hooksand the barrel —useDisclosure,useMediaQuery,useBreakpoint,usePrefersReducedMotion,useElementSize,useOnScreen,useShortcut.Every one is machinery the library already runs on, which is the whole selection rule: there is no general-purpose hook collection here and there is not going to be one.
useDisclosureis the caller's half of theopen/onOpenChangepair every overlay takes;useMediaQueryis the store PageLayout subscribes to, one liveMediaQueryListper query for the page;useElementSizeanduseOnScreenare the two shared observers;useShortcutis what CommandPalette binds its own opener with. -
Calendar— the pickers' grid, inline. It has been ininternal/since the first picker shipped, which meant a page wanting a month on it had to open a DatePicker and never close it.modeissingle,multipleorrange; a second click on a held day takes it out, and a range click below the start begins a new span rather than inverting the old one.renderDayputs a dot or a count under a number. It is not a scheduler, and the docs say so: the cells are the control ladder's heights. -
TreeSelect— the gap betweenSelectandTreeView.selectableBranchesis off by default because in most of these trees the branches are the taxonomy and the leaves are the answers, andsearchablekeeps every ancestor of a match and opens the branches it kept — a tree filtered to bare matches is a list, which is what the tree was chosen over. -
Image— the three things a bare<img>leaves to whoever wrote it:ratioreserves the box, a Skeleton stands in while the file arrives, and a box carrying thealtis drawn if it does not.altis required by the type, because a missing one and an empty one mean different things and only the second is ever correct. -
ConfirmProvideranduseConfirm— "are you sure?" as something you await. A promise rather than anonConfirm, because the code that asks is the code that acts. It never rejects; cancelling,Escapeand the backdrop all resolvefalse. Questions queue rather than replacing each other: resolving an older one to make room reports an answer nobody gave, which at the call site reads as "they said no". -
Popconfirm— the same question beside the control that raised it. The choice between the two is reach, not danger or size. -
VisuallyHiddenandPortal— two things the library has needed everywhere and kept to itself.VisuallyHiddenis the 1px clipped box behind a Chip's × and a chart's screen-reader table;Portaladds theneba-portalclass a scoped stylesheet finds a portalled subtree by, which is the reason to reach for it overcreatePortal. -
Five things on
DataTable— column pinning,columnOrderand drag-to-reorder, in-place cell editing,groupBywith per-columnaggregate, and CSV export. Each carries its own sharp edge in the docs: a pinned column moves to its edge, an order that does not name a key leaves it alone, editing needs both a column that allows it and a handler above it, grouping turns virtual scrolling off, and an export is every row the search and sort left rather than the page the reader is on.
Fixed
-
A folded group in
DataTablekept its rows but lost its own heading, so there was no way to unfold it. Caught by its own test on the way in; the body now renders group by group rather than deriving headings from the rows it can see. -
shortcutonCommandPalettenow binds every spellingShortcutdraws.Cmd+K,Command+K,Meta+KandEscall rendered a correct key cap and none of them fired;Ctrl+Kwas dead on Windows and Linux, because the matcher folded anyCtrlinto the platform'sModand then found noModin what it had been given. OnlyMod+…and a bare key ever worked.The cause was two spellings of one idea: the drawing side had an alias table and the binding side had a five-line predicate written separately.
src/internal/keys.tsis now the one place that decides which key a token names, and both sides read it — the aliases, the platform, and theAlt-on-a-Mac case whereevent.keyreports˚and the physical key has to be consulted instead. What a key looks like stays inShortcut.
Changed
-
minDate,maxDateandshouldDisableDateonDatePickerare read atgranularity. A minimum of 15 March leaves March pickable atmonth, since part of March is allowed, andshouldDisableDateis handed the value the cell would produce — the 1st, rather than a day inside the month it is being asked about.Nothing changes at
day, which is what every existing call is:isUnitOutsideat day granularity is theisDayOutsideit was before, character for character. The month grid was already making this comparison inline — it is the rule that keeps a month whoseminDatefalls inside it reachable — so the two coarser grids now call one function instead of restating it, and the footer's shortcut asks the same question the cells do.shouldDisableDatereaches a coarser grid only when that grid is the one being chosen from. Atdaya callback blocking weekends must not grey out every month whose 1st happens to be a Saturday. -
Every component reads its props through
useStyleDefaultsbefore its own destructuring. That is what makesNebaProvider's precedence come out as caller → provider → literal, and it is why every row of the table above moved.The keys are passed in per component rather than worked out, and that is load-bearing: a key a component does not destructure stays in the props it spreads onto its root, so filling
densityinto one that has none would putdensity="compact"on a<div>— andsizeon an<input>is a real attribute that would quietly resize the field. -
internal/media.tsowns the five breakpoint widths, which used to live inpage-layout.ts. A layout asks "narrower than this" and a caller asks "at least this"; two tables would be two chances to disagree about whatmdis.
Every release is in the changelog on the docs site and in CHANGELOG.md at this tag.