Skip to content

React JS for the web

The most basic way to use the @dnb/eufemia is like this:

Basic Buttons

<Button text="Basic Button" />

Importing the Components

To make the Button component work, we have to import it as well:

import { Button } from '@dnb/eufemia'

And here an example with several imports:

import { Button, Icon } from '@dnb/eufemia/components'
import { H1, P, Link } from '@dnb/eufemia/elements'
import { hamburger as hamburgerIcon } from '@dnb/eufemia/icons'

Events

<Button text="Button" on_click={() => console.log('click')} />

Now, let's jump to the Button Docs for more details.

Also, you may be interested in more code examples? Have a look at the Demo App on GitHub or Example for React.

Examples

Have a look at the demos as well as a Webpack example app and SSR example.