# tag (frontend)

UI for hierarchical document categories: tag chip lists, tag input with typeahead, and the admin tag-tree editor.

## What this domain owns

Components: `TagInput.svelte`, `TagChipList.svelte`, `TagParentPicker.svelte`.

## What this domain does NOT own

- Tag data management — CRUD is handled via the backend `tag/` domain
- Document association — adding/removing tags from documents is in `document/`

## Key components

| Component                | Used in                     | Notes                                                                                                                            |
| ------------------------ | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `TagInput.svelte`        | document edit form          | Multi-tag chip input with typeahead. Supports free-text creation and selecting existing tags. Exported for use by other domains. |
| `TagChipList.svelte`     | document rows, detail pages | Read-only display of a tag set                                                                                                   |
| `TagParentPicker.svelte` | admin tag editor            | Tree-aware parent selection                                                                                                      |

## Cross-domain imports

- `shared/hooks/useTypeahead.svelte.ts` — shared typeahead logic for `TagInput`

## Backend counterpart

`backend/src/main/java/org/raddatz/familienarchiv/tag/README.md`
