@@ -11,13 +11,13 @@ A component for displaying external links with consistent styling. Perfect for s
1111
1212### NqLinksItem Interface
1313
14- | Name | Type | Default | Description |
15- | --------- | -------- | ------------------- | ------------------------------------------------------------------------ |
16- | ` label ` | ` string ` | required | The text displayed for the link |
17- | ` href ` | ` string ` | required | The URL the link points to |
18- | ` icon ` | ` string ` | ` undefined ` | Optional icon class (e.g., ` i-nimiq:external ` ) |
19- | ` variant ` | ` string ` | ` nq-pill-secondary ` | Pill variant: ` blue ` , ` gold ` , ` green ` , ` secondary ` , ` tertiary ` , ` orange ` |
20- | ` title ` | ` string ` | ` undefined ` | Optional tooltip text for accessibility |
14+ | Name | Type | Default | Description |
15+ | --------- | ----------------- | ------------------- | -------------------------------- ------------------------------------------------------------------------ |
16+ | ` label ` | ` string ` | required | The text displayed for the link |
17+ | ` href ` | ` string ` | required | The URL the link points to |
18+ | ` icon ` | ` string \| false ` | auto-detected | Icon class or ` false ` to disable. Auto-detects icons for common domains (GitHub, Discord, Twitter, etc.) |
19+ | ` variant ` | ` string ` | first: ` nq-pill-blue ` , rest: ` nq-pill- secondary` | Pill variant: ` blue ` , ` gold ` , ` green ` , ` secondary ` , ` tertiary ` , ` orange ` |
20+ | ` title ` | ` string ` | ` undefined ` | Optional tooltip text for accessibility |
2121
2222All links automatically open in a new tab with ` target="_blank" ` and include ` rel="noopener noreferrer" ` for security.
2323
@@ -130,6 +130,46 @@ Use different pill variants to color-code your links.
130130
131131</ComponentPreview >
132132
133+ ### Auto-Detected Domain Icons
134+
135+ Links automatically get appropriate icons based on their domain. Set ` icon: false ` to disable.
136+
137+ <ComponentPreview lang =" vue " >
138+
139+ <NqPlayground >
140+ <NqLinks : items ="[
141+ {
142+ label: 'GitHub Repository',
143+ href: 'https://github.com/nimiq/ui '
144+ },
145+ {
146+ label: 'Discord Community',
147+ href: 'https://discord.gg/nimiq '
148+ },
149+ {
150+ label: 'Follow on Twitter',
151+ href: 'https://twitter.com/nimiq '
152+ },
153+ {
154+ label: 'No Icon Link',
155+ href: 'https://example.com ',
156+ icon: false
157+ }
158+ ] " />
159+ </NqPlayground >
160+
161+ </ComponentPreview >
162+
163+ #### Supported Domains
164+
165+ The following domains are automatically detected and assigned icons:
166+
167+ - ** Nimiq** : ` nimiq.com ` → ` i-nimiq:logos-nimiq-mono `
168+ - ** GitHub** : ` github.com ` → ` i-nimiq:logos-github-mono `
169+ - ** Discord** : ` discord.gg ` , ` discord.com ` → ` i-nimiq:logos-discord-mono `
170+ - ** Twitter/X** : ` twitter.com ` , ` x.com ` → ` i-nimiq:logos-twitter-mono `
171+ - ** Telegram** : ` telegram.org ` , ` t.me ` → ` i-nimiq:logos-telegram-mono `
172+
133173## Usage Notes
134174
135175- Use either ` item ` for a single link or ` items ` for multiple links, not both
0 commit comments