v13#
Note: There is no
v12release. The versionv12was accidentally published to NPM and has since been removed. Because a published version number cannot be safely reused,v12has been skipped entirely, and these breaking changes are released asv13instead.
Migration#
v13 of @dnb/eufemia contains breaking changes. Follow the migration steps below for removed APIs and changed behavior. The deprecations section lists APIs that remain available for compatibility and can be replaced separately.
Install#
To upgrade to @dnb/eufemia v13 with NPM, use:
$ npm i @dnb/eufemia@13# or$ yarn add @dnb/eufemia@13
License#
Before upgrading to a version distributed with the Eufemia DNB Project License v1.0, confirm that your project is owned by or developed on behalf of a DNB Group entity. The license permits internal and customer-facing DNB Group projects, including suppliers working on DNB's behalf. Use in unrelated projects requires a separate written agreement with DNB Bank ASA.
The license covers DNB-owned code, documentation, icons and other assets. Third-party materials and fonts remain subject to their own terms. Rights already granted under licenses accompanying earlier versions or separate agreements remain in effect, but do not automatically cover later versions.
Read the full license and usage guidance.
CSS custom properties#
Design-token color migration#
The design-token color update changes the meaning of --token-color-background-neutral-alternative in DNB and Eiendom and removes 13 foundation CSS custom properties. Applications must review direct references, including Tailwind utilities and values in JavaScript/TypeScript strings.
For text backgrounds, usually replace --token-color-background-neutral-alternative with --token-color-background-neutral-subtle. For UI fills such as progress tracks, usually use --token-color-background-neutral-base. Check contrast and nested surfaces in every supported theme and color mode; this is not a blanket find-and-replace.
See Migrating information and neutral colors for the before/after values, removed-variable inventory and application checklist. Follow that guidance when upgrading to the release containing this update, even if you are not upgrading to v13.
Typography:#
- Replace
--sb-font-size-*with--font-size-* - Replace
--sb-font-size-medium--pluswith--font-size-medium - Replace
--sb-line-height-*with--line-height-*
The font size and line height values now come from Figma brand tokens. Existing CSS variable names remain available.
The generated JavaScript properties exports keep their existing value format: concrete rem values for the size scale and aliases for lead.
The deprecated Sbanken-prefixed properties are still emitted. Their values differ from the generic scale, so check the rendered result when replacing them.
Tailwind#
- Replace
--text-sb-*with--text-* - Replace
--text-sb-medium--pluswith--text-medium - Replace
--leading-sb-*with--leading-*
Keyboard focus styling#
The keyboard focus guidance now uses a 3px blue outline with a 2px transparent gap, without changing text, icon, or background colors. Input fields keep their field focus styles. Lists, tables, cards, and similar layouts use no gap, and hover styling takes precedence while focused.
For new and updated custom styles, use --token-color-stroke-action-focus with --focus-outline-width (0.1875rem) and --focus-outline-offset (0.125rem), or the focusOutline() Sass helper. Layouts use a 3px blue edge: pass $offset: 0 without an existing edge, or overlap a 1px border or inset shadow with $offset: -0.0625rem and replace its color with the focus token. Use $width: 0.125rem (2px) if a scroll container's existing spacing would clip 3px. Remove focus-only text, icon, and background color overrides when migrating to the blue outline.
--focus-ring-width remains 0.25rem. The existing focus color tokens, focusRing(), focusStyle(), and focus helper classes remain available with their current behavior. No replacement is required to upgrade to v13. Migrate each usage individually; do not reduce the legacy width globally.
Print styles#
The dnb-print scope now prints pure black text, borders and form
outlines on white paper and removes descendant CSS backgrounds. Previously
this paper appearance required dnb-print--plain. Remove the redundant
modifier from existing markup:
-<article class="dnb-print dnb-print--plain">+<article class="dnb-print">
Existing markup with both classes still works. Screen colors, typography
and wrapper layout remain unchanged. If you relied on dnb-print to retain
brand colors when printing, use your own print styles outside this scope.
See print styles.
Component changes#
Tooltip#
Tooltip now describes its trigger before it opens and no longer announces its content through a live region.
If your application uses Tooltip for a status message, such as "Copied", add AriaLive to announce the message. Set omitDescribedBy on the Tooltip so the status message does not become the trigger's description:
<><Tooltip open={copied} targetElement={buttonRef} omitDescribedBy>Copied</Tooltip><AriaLive>{copied ? 'Copied' : null}</AriaLive></>
CopyOnClick, CopyOnClick.Button and NumberFormat handle their own copy announcements.
Theme#
The deprecated name property and data-name attribute have been removed. Use brand and data-brand instead.
-<Theme name="carnegie">+<Theme brand="carnegie">
Replace useTheme().name with useTheme().brand. For persisted theme state, replace getTheme().name and setTheme({ name }) with getTheme().brand and setTheme({ brand }).
VisibilityByTheme also matches on the theme object, so replace name there too:
-<VisibilityByTheme visible={[{ name: 'sbanken' }]}>+<VisibilityByTheme visible={[{ brand: 'sbanken' }]}>
With name removed, TypeScript reports it as an unknown property here. Plain JavaScript gets no such warning — the filter simply stops matching, and the content silently disappears.
The deprecated size property, ThemeSizes type, data-size attribute, and eufemia-theme__size--* CSS classes have also been removed. Use density, ThemeDensities, data-density, and eufemia-theme__density--* instead.
-<Theme size="basis">+<Theme density="basis">
The deprecated VisibilityByTheme.Name component has been removed. Use VisibilityByTheme.Brand instead.
-<VisibilityByTheme.Name />+<VisibilityByTheme.Brand />
SidebarMenu#
Replace breakpoint with drawerAt on SidebarMenu.ResponsiveProvider. The deprecated breakpoint alias is removed in v13.
SidebarMenu.Header now uses text for its label and children for the nested menu items. Move the previous label children to text. The deprecated, no-effect headingLevel compatibility property is removed in v13 because Header is a visual menu label rather than a semantic page heading.
-<SidebarMenu.Header headingLevel={3}>Accounts</SidebarMenu.Header>+<SidebarMenu.Header text="Accounts">+ <SidebarMenu.Item id="overview" text="Overview" />+</SidebarMenu.Header>
Flex#
Flex now uses native CSS gap and renders React children unchanged. The legacy compatibility APIs remain available during migration.
Custom components#
The _supportsSpacingProps marker is no longer needed. A custom component becomes a flex item through its rendered root, so nothing needs to opt it in to the layout. When the component should accept spacing properties, apply them to its root with useSpacing so an author can still adjust the spacing per instance.
Before (v11):
import { clsx } from 'clsx'import { useSpacing } from '@dnb/eufemia/components/space/SpacingUtils'function MyComponent({ className, ...props }) {const params = useSpacing(props, {...props,className: clsx('my-component', className),})return <div {...params} />}// Opted the component in to receive spacing from Flex.Container.MyComponent._supportsSpacingProps = true
After (v13):
import { clsx } from 'clsx'import { useSpacing } from '@dnb/eufemia/components/space/SpacingUtils'function MyComponent({ className, ...props }) {const params = useSpacing(props, {...props,className: clsx('my-component', className),})return <div {...params} />}
For a component that already applied spacing to its root, deleting the marker is the only change. The rendered <div> is now a flex item automatically, and useSpacing keeps the component's own top, right, bottom, and left props working — in CSS mode those values participate in pairwise spacing and may replace the adjacent container gap. If a component did not previously apply spacing to its root, adopt useSpacing as shown so authors can keep adjusting spacing per instance. A component that never needs per-instance spacing can simply drop the marker and receive the container gap.
Wrapper components#
Flex.withChildren remains available as a deprecated compatibility adapter. It never hoisted a wrapper's children into the outer container's flex line. When the HOC marked a wrapper, Flex.Container automatically injected a nested Flex.Container inside the wrapper's root, inheriting the outer container's props, and laid the wrapper's children out there. The rendered DOM was already outer container → wrapper root → inner container. To keep that layout without the adapter, render the inner Flex.Container yourself.
Before (v11):
import { Flex } from '@dnb/eufemia'// The HOC marked the wrapper, so Flex.Container injected a nested// Flex.Container inside it to lay out the wrapper's children.const Wrapper = Flex.withChildren(({ children }) => <div>{children}</div>)render(<Flex.Container direction="vertical"><Item /><Wrapper><Item /><Item /></Wrapper><Item /></Flex.Container>)
After (v13):
import { Flex } from '@dnb/eufemia'// Render the inner Flex.Container yourself — this is the container// the HOC used to inject automatically.function Wrapper({ children }) {return (<div><Flex.Container direction="vertical">{children}</Flex.Container></div>)}render(<Flex.Container direction="vertical"><Item /><Wrapper><Item /><Item /></Wrapper><Item /></Flex.Container>)
The DOM structure is unchanged from v11 — a wrapper root containing a nested Flex.Container. The only difference is that you now provide that inner container explicitly and set its own props (direction, gap, divider, …) instead of inheriting them from the outer container. If a wrapper renders no DOM of its own — for example a Fragment, a context provider, or another transparent component — its children already become direct flex items of the outer container and need no inner Flex.Container.
When using divider="line" or divider="line-framed", the CSS engine paints the divider without rendering <hr> elements. This removes the corresponding separator roles from the accessibility tree. If a divider conveys semantic separation, render explicit Hr elements instead of relying on the divider property.
Accordion#
- Replace
idwithconnectedToonAccordion.Contentwhen connecting to a standalone tertiary button.
DatePicker#
- Remove
enableKeyboardNav. It has no effect, because keyboard navigation in the calendar is always enabled.
Modal, Dialog and Drawer#
- Replace
closeButtonAttributeswithcloseButtonProps.
-<Drawer closeButtonAttributes={{ text: 'Custom text' }} />+<Drawer closeButtonProps={{ text: 'Custom text' }} />
- Replace
triggerAttributeswithtriggerProps.
-<Dialog triggerAttributes={{ text: 'Open', variant: 'primary' }} />+<Dialog triggerProps={{ text: 'Open', variant: 'primary' }} />
- The
ModalTriggerAttributestype has been removed. UseButtonPropsfrom@dnb/eufemiainstead.
InfoCard#
Replace InfoCard with Card.Info and compose its content as children. Card.Info supplies the card surface, shadow, and padding. See Card.Info for layout, sizing, interaction, and dismissal guidance.
Before:
<InfoCardtitle="Savings tip"text="Save a little every month."acceptButtonText="Start saving"onAccept={onAccept}/>
After:
<Card.Info><Flex.Stack gap="x-small"><P size="small" weight="medium">Savings tip</P><P size="small">Save a little every month.</P></Flex.Stack><Button variant="secondary" onClick={onAccept}>Start saving</Button></Card.Info>
- Replace
textwith paragraph children. Use heading children or Card'stitleproperty for the title. - Replace
icon,src,alt, andimgPropswith IconPrimary, Img, or other graphic children. Include appropriate alternative text. - Replace accept and close button props, including the
*ButtonAttributesaliases, with explicit Button children. For a top-corner close control, renderCard.Info.CloseButtonas a direct Card.Info child and pass the dismissal handler asonClick. - Replace
centeredwith your content layout, for exampleFlex.Stack align="center"and centered text. Wrap loading content inProvider skeleton. - Remove
stretchand control width through the containing layout. Other Card properties, including spacing anddropShadow, can be passed directly to Card.Info.
Popover#
- Replace
triggerAttributeswithtriggerProps.
-<Popover triggerAttributes={{ 'aria-haspopup': 'menu' }} />+<Popover triggerProps={{ 'aria-haspopup': 'menu' }} />
- The
PopoverTriggerAttributestype has been removed. UsetriggerPropsinstead.
Typography#
- Replace
<Typography.Provider>with<Typography.Context>.
-<Typography.Provider/>+<Typography.Context/>
ScrollView#
- The deprecated
ScrollViewexport from@dnb/eufemia/fragmentshas been removed. Import it from the main package instead.
-import { ScrollView } from '@dnb/eufemia/fragments'+import { ScrollView } from '@dnb/eufemia'
Field.Name.Company#
- The
onBlurValidatorproperty now only accepts aCompanyNameValidator, and itsvalidatorsno longer includenameValidator. UsecompanyValidatorinstead.
-import type { NameValidator } from '@dnb/eufemia/extensions/forms/Field/Name'+import type { CompanyNameValidator } from '@dnb/eufemia/extensions/forms/Field/Name'-const myValidator: NameValidator = (value, { validators }) => {- return [validators.nameValidator]+const myValidator: CompanyNameValidator = (value, { validators }) => {+ return [validators.companyValidator]}
Chat extension#
The Ai extension is now named Chat because the components support human-to-human conversations as well as AI experiences.
-import { Ai } from '@dnb/eufemia/extensions'-import '@dnb/eufemia/extensions/ai/style'+import { Chat } from '@dnb/eufemia/extensions'+import '@dnb/eufemia/extensions/chat/style'
Replace Ai.Message, Ai.Conversation and other namespace uses with Chat.*. Named component imports move from @dnb/eufemia/extensions/ai to @dnb/eufemia/extensions/chat; public types use the Chat prefix, such as ChatMessageProps. The optional virtualization driver and isolated styles are also available under extensions/chat/Virtualization and extensions/chat/style/isolated.
Ai remains available as a compatibility fallback for now. Existing imports, Ai* types, locale imports and style entry points still use the same implementation. Existing .dnb-ai-* CSS classes and --ai-* custom properties remain unchanged. Documentation URLs redirect to Chat.
Use the Chat namespace for translation overrides. Legacy Ai overrides still work; Chat takes precedence for keys provided in both namespaces. The extension remains experimental. AI-specific features such as aiGenerated are still opt-in; use them only when they describe the content correctly.
Deprecations#
Deprecated APIs remain available for compatibility. Replacing them is recommended, but deprecation alone does not require a change to upgrade to v13. Removal is a separate breaking change and is documented explicitly.
ToggleButton#
ToggleButton and ToggleButton.Group are deprecated in favor of Chip. Existing imports, styles, and behavior remain available. Migration is recommended for new or updated interfaces, but is not required to upgrade to v13. No removal version is scheduled.
-import { ToggleButton } from '@dnb/eufemia'+import { Chip } from '@dnb/eufemia'-<ToggleButton.Group multiselect values={['savings']}>- <ToggleButton value="savings" text="Savings" />- <ToggleButton value="funds" text="Funds" />-</ToggleButton.Group>+<Chip.Group selectionMode="multiple" values={['savings']}>+ <Chip value="savings">Savings</Chip>+ <Chip value="funds">Funds</Chip>+</Chip.Group>
Single selection remains the default. Set value on Chip.Group for single selection and values for multiple selection. Move initial selection from a child's checked to its group. Standalone chips still use checked.
Use text or children for the option name and Chip.Group's label for the group label. Chip's labelSrOnly hides the option name; the group property hides the group label. Replace leftComponent with icon for decorative content. Evaluate custom icon placement and size against Chip's leading icon layout. Keep interactive help in suffix, outside the selectable chip. Replace function children with their rendered React content.
Use string or number identifiers instead of object or array values. Match option and group value types, and keep identifiers unique after conversion to strings. Change events preserve the identifier type. Chip.Group returns values in both selection modes and value identifies the changed option.
Chip renders native inputs, except for addable chips outside single selection groups, which use native toggle buttons with aria-pressed. Update refs, event target assumptions, CSS selectors, and tests that depend on ToggleButton's button markup. Selected, enabled options in Chip.Group participate in native form submission. Set name on Chip.Group to choose the submitted field name; otherwise a generated name is used. Radio groups use one Tab stop and arrow keys; multiple selection uses independently focusable checkboxes or addable toggle buttons. variant controls appearance independently of selection mode.
See Chip's API differences and examples.
Flex compatibility APIs#
The following deprecated APIs remain available during migration:
Flex.withChildren_supportsSpacingPropswrapChildrenInSpacelayoutEngine="legacy"
The previous child-inspection engine can still be selected explicitly:
<Flex.Container layoutEngine="legacy">...</Flex.Container>
Avoid these APIs for new integrations. See the Flex migration steps and Flex.Container migration guidance for alternatives.
Autocomplete#
The individual search-related props remain supported as deprecated aliases for the search object. Replace them when updating the component:
disableFilter→search.filterdisableReorder→search.reorderdisableHighlighting→search.highlightsearchNumbers→search.numberssearchInWordIndex→search.matchInsideWordsFromsearchMatch→search.match
Note that the disable* props invert, so a disabled feature becomes false:
-<Autocomplete- disableFilter- disableReorder- disableHighlighting- searchNumbers- searchInWordIndex={4}- searchMatch="starts-with"-/>+<Autocomplete+ search={{+ filter: false,+ reorder: false,+ highlight: false,+ numbers: true,+ matchInsideWordsFrom: 4,+ match: 'starts-with',+ }}+/>
Img#
- The
imgClassalias is deprecated but still supported. UseimageClassNamefor new code. - The
elementprop is deprecated and remains available. Keep the defaultfigurewrapper and usefigurePropsto pass native properties to it.
-<Img src="image.png" alt="Description" imgClass="image-class" />+<Img src="image.png" alt="Description" imageClassName="image-class" />
Provider#
The top-level currencyDisplay property is deprecated and remains in the Provider types. It already had no effect on NumberFormat; this is not a v13 behavior change. To configure currency display, use NumberFormat={{ currencyDisplay }} instead.
-<Provider currencyDisplay="code">+<Provider NumberFormat={{ currencyDisplay: 'code' }}>