Components as designed by UX implemented in React
npm install @havforsk/react-componentsA React component library based on Designsystemet by DigDir. This library provides re-exported components from @digdir/designsystemet-react, as well as a few custom components tailored for our internal use.
``bash`
npm install @havforsk/react-components
To start using the components:
1. Import the CSS
In your main CSS file (e.g., index.css or App.css), add:
`css`
@import "@havforsk/react-components/index.css";
2. Use Components
Import components as needed:
`js`
import { Button } from "@havforsk/react-components";
Most components in this library are direct re-exports from Designsystemet. For full documentation and usage examples, refer to their Storybook.
Some components are custom-built and maintained separately. These are documented in our internal Storybook instance.
The older version of this component library, which is not based on Designsystemet, is still available:
`js`
import { Something } from "@havforsk/react-components/old";
This package has peer dependencies on:
- @digdir/designsystemet-react@digdir/designsystemet-css
-
These will be automatically installed via npm, but you can control the versions manually if needed:
`bash`
npm install @digdir/designsystemet-css @digdir/designsystemet-react
This may be useful if, for example, Designsystemet has new components not exposed through this library. You can import them directly from Designsystemet:
`bash``
import { Button } from "@digdir/designsystemet-react";
---
For issues, contributions, or internal usage guidelines, refer to the internal documentation or contact the UI team.