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-vue3 dkfds
# or
pnpm add @madsb/dkfds-vue3 dkfds
Required peer dependencies: vue@^3.4.0
and dkfds@^11.0.0
// main.ts
import { createApp } from 'vue'
import dkfdsvue3 from '@madsb/dkfds-vue3'
import App from './App.vue'
const app = createApp(App)
app.use(dkfdsvue3)
app.mount('#app')
Choose one of these approaches:
// main.ts
import '@madsb/dkfds-vue3/dist/dkfds-vue3.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-vue3/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-vue3/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-vue3/styles';
<script setup lang="ts">
import { FdsButton, FdsAlert, FdsInput } from '@madsb/dkfds-vue3'
</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>
// Import composables and utilities
import { useToast, formId } from '@madsb/dkfds-vue3/composables'
import { generateId, navigation } from '@madsb/dkfds-vue3/utils'
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-vue3/styles';
# Install dependencies
pnpm install
# Build the library
pnpm run build
# Run demo site
pnpm run dev
# Development
pnpm run dev # Run demo site
pnpm run build # Build library
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 UI
src/
βββ 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
examples/
βββ demo/ # Demo application showcasing components
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
See the demo site for complete component examples.
# Run tests
pnpm test
# Run tests with coverage
pnpm test:coverage
# Type checking
pnpm typecheck
# Check with strict mode (shows potential improvements)
./typecheck-strict.sh
MIT License - Fork of dkfds-vue3 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.