Version 3 drops the styled-jsx runtime: every component now ships plain, static CSS instead of injecting <style> tags at render time.
This page lists what changes and what to do about it. The documentation of v2 stays available at v2.bolio-ui.com.
Version 2 was only published as alphas, so most projects come from 1.x or from a v2 alpha. Coming from 1.x, read the migration guide to v2 first, then this page. Install v3 with:
pnpm add @bolio-ui/core
Styling used to be injected by styled-jsx on every render. Now it ships as a real .css file, so every app needs one import, once, anywhere before the components render:
import '@bolio-ui/core/styles.css'
Without it, components render unstyled. Add it next to your other top-level imports (pages/_app.js, app/layout.js, src/main.tsx, and so on). See Getting Started for the setup of each router and framework.
StyledJsxRegistry and @bolio-ui/core/next are goneThe App Router no longer needs a styles registry, because nothing is rendered into the HTML at request time anymore. Remove the wrapper:
// v2: app/layout.js
import { BolioUIProvider, CssBaseline } from '@bolio-ui/core'
import { StyledJsxRegistry } from '@bolio-ui/core/next'
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<StyledJsxRegistry>
<BolioUIProvider>
<CssBaseline />
{children}
</BolioUIProvider>
</StyledJsxRegistry>
</body>
</html>
)
}
// v3: no registry, just the stylesheet import
import '@bolio-ui/core/styles.css'
import { BolioUIProvider, CssBaseline } from '@bolio-ui/core'
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<BolioUIProvider>
<CssBaseline />
{children}
</BolioUIProvider>
</body>
</html>
)
}
A custom server needs nothing beyond serving the stylesheet (or letting your bundler include it) and rendering the app normally: no registry to collect styles from.
styled-jsx is no longer a dependencyThe package does not depend on styled-jsx anymore. If nothing else in your app uses it, you can remove it too.
@bolio-ui/core/next was removed from the exports map. These paths work:
| Path | What it is |
|---|---|
@bolio-ui/core | All components and hooks |
@bolio-ui/core/styles.css | The stylesheet. Import it once |
@bolio-ui/core/css/* | One stylesheet per component, for apps that want to import only what they use instead of the combined file |
@bolio-ui/core/dist/* | Deep imports of the CommonJS build, as before. They work in Node and in bundlers |
@bolio-ui/core/esm/* | Deep imports of the ES modules build, as before. They are for bundlers: Node cannot load them as they are, so in Node import the package root or dist/* |
Other paths are no longer resolved.
Rating was rebuiltThe old Rating changed its value on hover and then locked on click. Now the value only changes on click or with the arrow keys, and hover shows a preview.
onValueChange is now onChange.locked and onLockedChange are gone. Use readOnly or disabled.initialValue now defaults to 0, not 1.RatingCount and RatingValue are gone: count and value are plain numbers.precision, variant, emptyIcon, clearable, highlightSelectedOnly, onHoverChange and getLabel.@layer, all of them below any unlayered CSS you write. A plain, unlayered selector in your own stylesheet always wins over a component's default style now, with no need for !important or extra specificity.Button-module_root__a1b2c) replace the old styled-jsx hash. Neither was ever meant to be targeted directly; use the documented props and CSS custom properties instead.CssBaseline now sets box-sizing: border-box on the page, and every element inherits it. A width or a height now includes the padding and the border. If your own styles assumed content-box, check the elements that have both a size and a border or padding.div with role="button". A selector that targeted that div needs to change. Collapse.Group also moves the focus between the titles with the arrow keys, Home and End.type and variant, in place of the fixed gray.CssBaseline sets color-scheme on the page, so the clock of a time field, the scrollbars and the pickers of the browser are drawn for a dark page on the dark theme.These are in v3 and were not in 2.0.0-alpha.2, or in 1.x. Nothing was removed.
Existing components also got new props: Collapse has visible, onVisibleChange and disabled, Calendar has numberOfMonths, and Table has sortable columns (sortable and sorter), sort, selectable, rowKey and selectedKeys.
@bolio-ui/core 3.0.0 or later.import '@bolio-ui/core/styles.css' once, near your other top-level imports.StyledJsxRegistry and the @bolio-ui/core/next import from your App Router layout, if you had one.styled-jsx from your own dependencies if nothing else in your app uses it.!important.