Eufemia quick reference
This is a compact, practical guide for teams who already know they want Eufemia and need the fastest path to decisions and common patterns.
Before you build
- Choose the brand theme:
ui(default),sbanken,carnegie, oreiendom(theming).
- Form-heavy flow?
- Prefer the Forms extension and
Field.*components for validation and structure.
- Prefer the Forms extension and
- Multi-step journeys?
- Use Wizard for step navigation and focus management.
- Loading states?
- Plan for Skeleton or ProgressIndicator.
- Internationalization?
- Plan for localization and i18n.
- Styling strategy?
- Decide how to import styles and whether you need style isolation.
Setup
npm i @dnb/eufemia react react-dom
// App entry - import styles onceimport '@dnb/eufemia/style'// Components and other importsimport { Button, Input, Card, Dialog, Icon } from '@dnb/eufemia'import { H1, H2, P } from '@dnb/eufemia'import { Flex, Space } from '@dnb/eufemia'import {Form,Field,Value,Wizard,Iterate,Connectors,} from '@dnb/eufemia/extensions/forms'import { ChildrenWithAge } from '@dnb/eufemia/extensions/forms/blocks'import {Provider,Theme,useTheme,useSharedContext,useTranslation,useMedia,} from '@dnb/eufemia/shared'
Key conventions
- Prefer Flex and Forms over other layout and form solutions.
- Use
Field.*components for user input and forms whenever available (all fields). - Follow accessibility basics and avoid font sizes below 14px.
- Use the spacing system and Space instead of ad-hoc margins.
- Import styles once at the app root (
import '@dnb/eufemia/style'). - Prefer helpers and tools over custom one-off utilities.
- Use HTML elements for semantic structure, even when not using components.
- Favor CSS custom properties and spacing helpers over hard-coded values (Spacing, Typography).
Detailed references
See Forms for validation, schema, and more fields.
Forms essentials
- Start with Getting started for forms patterns, validation, and data handling.
- Use Form.Handler for submit/validation and GlobalStatus for error summaries.
- For multi-step flows, use Wizard.
- For edit/view modes, use Form.Section.
- Prefer feature fields (e.g.
Field.*) when available. - For read-only outputs, use Value components (e.g.
Value.*). - Most
Field.*components have a correspondingValue.*component; you can mix fields and values in the same form. - For read-only summaries, use Value.SummaryList.
- Validation schemas can be provided via Zod or AJV JSON Schema.
AI instructions and skills
Eufemia's documentation is optimized for AI assistance. When generating or reviewing code, use the following sources in order of priority.
- Use the documentation exactly as provided.
- Gather all required information from the documentation before using it as a reference.
- Do not make assumptions or infer missing details unless explicitly instructed to do so.
Versioned documentation (preferred)
- Install
@dnb/eufemiawith the package manager used in your project (e.g., npm, yarn, pnpm). - Find where
node_modulesis located in your project. - Read docs from
node_modules/@dnb/eufemia/docs/uilib/usage/first-steps/quick-reference.md. - Follow relative links between markdown files.
- Use this content as the primary reference.
Non-versioned documentation
- Fetch
https://eufemia.dnb.no/uilib/usage/first-steps/quick-reference.md. - Read docs from the fetched markdown file.
- Follow absolute URLs for referenced markdown files.
- Use this content as a reference only.