Compared with KDS's component
How dk-address differs from the Adressevælger component that KDS publishes on GitHub.
KDS publishes its own address field: a JavaScript component, distributed on GitHub. Both search the same KDS API and find the same addresses. They differ in how you install and type them, in how the field behaves while people fill it in, and in what your code depends on. This page compares against version 5.0.1 of KDS's component, the current version in November 2026.
At a glance
| KDS's component | dk-address | |
|---|---|---|
| Install | Copy files from GitHub, again for every update | npm i @dk-address/react |
| Types | None: plain JavaScript | TypeScript types for every option, suggestion and address |
| Option and field names | Danish, as KDS sends them | English |
| Your code reads | KDS's response format | dk-address's types, with KDS's object as raw |
| After picking a street | The text is replaced; the caret isn't placed | The caret goes where the house number goes |
| House numbers | Whole numbers only: 2 doesn't find 28 | Matched by prefix as you type |
| Waits before searching | 500 ms (300 ms in the web component) | 100 ms, and no wait after a pick |
| Styling | Global CSS classes on a list it renders | Your className on each part, or blocks for shadcn/ui and Ant Design |
| Keyboard focus | Arrow keys move focus from the input into the list | Focus stays in the input, following the ARIA combobox pattern |
| Removing it | No method to remove the DOM version | Components and hooks clean up when they unmount |
| Token | Required option | KDS's shared token by default |
Installing and updating
KDS distributes its component only through GitHub. You copy adressevaelger.iife.js or adressevaelger.esm.js and the stylesheet into your project, and copy them again for every new version. dk-address is a set of npm packages, so updates come through your package manager and your lockfile.
Types and names
KDS's component is plain JavaScript without type definitions. Its options use KDS's Danish parameter names, and select receives KDS's response object as it is. dk-address types every option and result, with English names:
| KDS's component | dk-address |
|---|---|
kommuneKode: "0101" | municipalityCodes: ["0101"] |
maksimum: 20 | limit: 20 |
medtagForeloebige: true | includeProvisional: true |
adgangsadresserOnly: true | kind: "accessAddress" |
select(selected), KDS's object | onSelect(selection), a typed address in selection.details |
Protection from API changes
Moving from DAWA to KDS changed the response format, so apps that read DAWA's fields had to change wherever they read an address. With KDS's component, your code reads KDS's response directly, and the next change at KDS reaches your code the same way.
With dk-address, your code reads dk-address's types instead. A change at KDS is handled by updating dk-address, not in every component that reads an address. When you need a field dk-address doesn't map, the untouched KDS object is still there as raw.
Filling in an address
Both components refine: picking a street searches again within that street. They differ in what happens next:
- Caret placement: KDS's component replaces the text with the street and leaves the caret wherever the browser puts it. dk-address puts the caret where the house number goes (
Vesterbrogade |, 1620 København V), and after a building, where floor and door go. - House numbers: KDS matches whole house numbers only, so with KDS's component
Vesterbrogade 2, 1620finds nothing on the way to28. dk-address also matches the street's house numbers by prefix. - Gap hints: dk-address tells your UI which part the caret is in (
houseNumberorunit), so you can show a hint like "Type the house number".
How it works walks through each step.
Styling, React and keyboard
KDS's component renders its own list, styled with global CSS classes (.adressevaelger-suggestions, .dawa-selected) and positioned inside a wrapper div you add. dk-address renders unstyled parts that take your className and positions the popup against the input, flipping it when there's no room. If you use a component library, you can skip dk-address's UI and drive the library's own autocomplete instead.
The DOM version of KDS's component adds a document-wide click listener and has no method to remove it, which matters when React mounts and unmounts the field. dk-address's components and hooks cancel pending requests and clean up when they unmount.
With KDS's component, the arrow keys move focus out of the input and into the list. dk-address keeps focus in the input, as the ARIA combobox pattern describes, so people can keep typing while they browse suggestions.
When KDS's component fits better
KDS's component needs no build step: one script tag and one stylesheet give you a working field. On a page without npm or a bundler, that's less setup than dk-address, which you install from npm.