Vue 3 component library implementing Det Fælles Designsystem (DKFDS) v11.
β¨ 40+ accessible Vue 3 components following Danish government design standards
π― WCAG 2.1 AA compliant with comprehensive accessibility support
π¦ Modern ESM-only package with full TypeScript support
π² Tree-shakeable - Import only what you need
π¨ Theme-agnostic - Works with any DKFDS theme (Virkdk, Borgerdk, or default)
npm install @madsb/dkfds-vue-kit dkfds
# or
pnpm add @madsb/dkfds-vue-kit dkfdsRequired peer dependencies: vue@^3.4.0 and dkfds@^11.0.0
// main.ts
import { createApp } from 'vue'
import dkfdsVueKit from '@madsb/dkfds-vue-kit'
import App from './App.vue'
const app = createApp(App)
app.use(dkfdsVueKit)
app.mount('#app')Choose one of these approaches:
// main.ts
import '@madsb/dkfds-vue-kit/dist/dkfds-vue-kit.css'Simple two-step integration:
Default Theme (Generic DKFDS):
// main.scss
// 1. Import DKFDS base styles with default theme
@use '../../node_modules/dkfds/src/stylesheets/dkfds' as dkfds with (
$font-path: '../../node_modules/dkfds/src/fonts/IBMPlexSans/',
$image-path: '../../node_modules/dkfds/src/img/',
$icons-folder-path: '../../node_modules/dkfds/src/img/svg-icons/'
);
// 2. Import Vue3 components - one simple import!
@use '@madsb/dkfds-vue-kit/styles';Virk Theme (for virk.dk solutions):
// main.scss
// 1. Import DKFDS base styles with Virk theme
@use '../../node_modules/dkfds/src/stylesheets/dkfds-virkdk' as dkfds with (
$font-path: '../../node_modules/dkfds/src/fonts/IBMPlexSans/',
$image-path: '../../node_modules/dkfds/src/img/',
$icons-folder-path: '../../node_modules/dkfds/src/img/svg-icons/'
);
// 2. Import Vue3 components - one simple import!
@use '@madsb/dkfds-vue-kit/styles';Borger Theme (for borger.dk solutions):
// main.scss
// 1. Import DKFDS base styles with Borger theme
@use '../../node_modules/dkfds/src/stylesheets/dkfds-borgerdk' as dkfds with (
$font-path: '../../node_modules/dkfds/src/fonts/IBMPlexSans/',
$image-path: '../../node_modules/dkfds/src/img/',
$icons-folder-path: '../../node_modules/dkfds/src/img/svg-icons/'
);
// 2. Import Vue3 components - one simple import!
@use '@madsb/dkfds-vue-kit/styles';<script setup lang="ts">
import { FdsButton, FdsAlert, FdsInput } from '@madsb/dkfds-vue-kit'
</script>
<template>
<fds-alert type="info">Welcome!</fds-alert>
<fds-input v-model="name" label="Your name" />
<fds-button @click="submit">Submit</fds-button>
</template>All composables, utilities, and types are available via the root entry point so you only need one import path.
// Import composables and utilities
import { useToast, formId, generateId, navigation } from '@madsb/dkfds-vue-kit'This library provides simple DKFDS integration that works with any official theme:
| Theme | DKFDS Stylesheet | Colors | Use Case |
|---|---|---|---|
| Default | dkfds |
Generic DKFDS blue | Development, testing, generic use |
| Virk | dkfds-virkdk |
Virk.dk blue | Government websites and applications |
| Borger | dkfds-borgerdk |
Borger.dk green | Public-facing citizen services |
- β Dead simple - Two imports: DKFDS base + Vue3 components
- β Official colors - DKFDS handles all theme colors
- β
Modern SCSS - Uses latest Sass module system (
@use/@forward) - β Theme-agnostic - Works with any DKFDS theme
- β No deprecation warnings - Dart Sass 2.0+ compatible
Change themes by updating your DKFDS stylesheet import:
// From this:
@use '../../node_modules/dkfds/src/stylesheets/dkfds-virkdk' with (...);
// To this:
@use '../../node_modules/dkfds/src/stylesheets/dkfds-borgerdk' with (...);
// Vue3 import stays the same
@use '@madsb/dkfds-vue-kit/styles';# Install dependencies
pnpm install
# Build the library
pnpm run build
# Run documentation site
pnpm run docs:dev# Development
pnpm run build # Build library
pnpm run docs:dev # Run documentation site
pnpm run test # Run tests
pnpm run typecheck # Check TypeScript types
pnpm run lint # Lint code
pnpm run format # Format code
# Testing
pnpm run test:run # Run tests once
pnpm run test:coverage # Run tests with coverage
pnpm run test:ui # Run tests with UIsrc/
βββ components/ # Vue components organized by category
β βββ forms/ # Form structure components
β βββ input/ # Input and form control components
β βββ navigation/ # Navigation and menu components
β βββ feedback/ # User feedback (alerts, toasts, modals)
β βββ data-display/ # Data presentation components
β βββ layout/ # Layout and utility components
βββ composables/ # Vue composables
βββ utils/ # Utility functions
βββ types/ # TypeScript type definitions
βββ index.ts # Main entry point
40+ components organized by category:
- Forms:
FdsFormgroup,FdsLabel,FdsHint,FdsFejlmeddelelse - Input:
FdsInput,FdsCheckbox,FdsDropdown,FdsFileUpload - Navigation:
FdsBreadcrumb,FdsMenu,FdsPaginering,FdsTrinindikator - Feedback:
FdsAlert,FdsToast,FdsModal,FdsSpinner - Data Display:
FdsAccordion,FdsCard,FdsList,FdsTable - Layout:
FdsButton,FdsIkon,FdsCookiemeddelelse
# Run tests
pnpm test
# Run tests with coverage
pnpm test:coverage
# Type checking
pnpm typecheck
# Check with strict mode (shows potential improvements)
./typecheck-strict.shMIT License - Fork of dkfds-vue-kit by Kenneth Torsten RΓΈrstrΓΈm
Built on Det Fælles Designsystem by the Danish Agency for Digital Government
Contributions welcome! Please ensure tests pass and follow DKFDS specifications.