Skip to content

React JS for the web

The most basic way to use the dnb-ui-lib is like this:

Basic Buttons

Importing the Components

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

import { Button } from 'dnb-ui-lib'

And here an example with several imports:

import { Button, Icon } from 'dnb-ui-lib/components'
import { H1, P, Link } from 'dnb-ui-lib/elements'
import { hamburger as hamburgerIcon } from 'dnb-ui-lib/icons/secondary_icons'

Events

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.