Skip to content

Import

import { Logo } from '@dnb/eufemia'

Description

A ready to use Logo component with the needed SVGs.

Relevant links

Logo that changes based on theme

You can import the SVGs for each brand like this:

import {
DnbDefault,
SbankenDefault,
SbankenCompact,
CarnegieDefault,
EiendomDefault,
} from '@dnb/eufemia/components/Logo'

You can then create your helper function to get the right SVG based on the current theme:

import type { ThemeProps } from '@dnb/eufemia/shared/Theme'
function getLogoSvg(theme: ThemeProps) {
switch (theme?.name) {
case 'sbanken':
return SbankenDefault
case 'carnegie':
return CarnegieDefault
case 'eiendom':
return EiendomDefault
default:
return DnbDefault
}
}