Skip to content

Icons

Empathy DS uses Lucide Vue Next as its icon library. Lucide provides 1000+ beautiful, consistent icons.

Installation

Lucide is included as a dependency of @empathyds/vue, but you can also install it directly:

bash
pnpm add lucide-vue-next
bash
npm install lucide-vue-next
bash
yarn add lucide-vue-next
bash
bun add lucide-vue-next

Basic Usage

Import icons individually for optimal tree-shaking:

vue
<script setup>
import { Check, X, ChevronRight, Loader2 } from 'lucide-vue-next'
</script>

<template>
  <Check class="h-4 w-4" />
  <X class="h-4 w-4" />
  <ChevronRight class="h-4 w-4" />
  <Loader2 class="h-4 w-4 animate-spin" />
</template>

Icon Sizes

Use consistent sizing with Tailwind:

ClassSizeUsage
h-3 w-312pxVery small, badges
h-4 w-416pxButtons, inputs (default)
h-5 w-520pxLarger buttons
h-6 w-624pxStandalone icons
h-8 w-832pxFeature icons
h-12 w-1248pxHero/empty states

With Components

Buttons with Icons

vue
<script setup>
import { Button } from '@empathyds/vue'
import { Plus, Trash2, Download, ExternalLink } from 'lucide-vue-next'
</script>

<template>
  <!-- Icon before text -->
  <Button>
    <Plus class="mr-2 h-4 w-4" />
    Add Item
  </Button>
  
  <!-- Icon after text -->
  <Button variant="outline">
    Open Link
    <ExternalLink class="ml-2 h-4 w-4" />
  </Button>
  
  <!-- Icon only -->
  <Button variant="ghost" size="icon">
    <Trash2 class="h-4 w-4" />
    <span class="sr-only">Delete</span>
  </Button>
  
  <!-- Loading state -->
  <Button disabled>
    <Loader2 class="mr-2 h-4 w-4 animate-spin" />
    Please wait
  </Button>
</template>

Input with Icon

vue
<script setup>
import { Input } from '@empathyds/vue'
import { Search, Mail } from 'lucide-vue-next'
</script>

<template>
  <div class="relative">
    <Search class="absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
    <Input class="pl-10" placeholder="Search..." />
  </div>
</template>
vue
<script setup>
import { 
  DropdownMenu, 
  DropdownMenuContent, 
  DropdownMenuItem, 
  DropdownMenuTrigger 
} from '@empathyds/vue'
import { User, Settings, LogOut } from 'lucide-vue-next'
</script>

<template>
  <DropdownMenu>
    <DropdownMenuTrigger>Open</DropdownMenuTrigger>
    <DropdownMenuContent>
      <DropdownMenuItem>
        <User class="mr-2 h-4 w-4" />
        Profile
      </DropdownMenuItem>
      <DropdownMenuItem>
        <Settings class="mr-2 h-4 w-4" />
        Settings
      </DropdownMenuItem>
      <DropdownMenuItem>
        <LogOut class="mr-2 h-4 w-4" />
        Sign out
      </DropdownMenuItem>
    </DropdownMenuContent>
  </DropdownMenu>
</template>

Common Icons

Actions

IconNameUsage
PlusAdd/create
✏️PencilEdit
🗑️Trash2Delete
💾SaveSave
XClose/cancel
CheckConfirm/success
IconNameUsage
ChevronRightNavigate forward
ChevronLeftNavigate back
ChevronDownExpand/dropdown
ChevronUpCollapse
MoreHorizontalMore options
MoreVerticalMore options
🏠HomeHome
MenuMenu/hamburger

Status

IconNameUsage
ℹ️InfoInformation
⚠️AlertTriangleWarning
🔴AlertCircleError
CheckCircleSuccess
🔄Loader2Loading (with animate-spin)

User Interface

IconNameUsage
🔍SearchSearch
⚙️SettingsSettings
👤UserUser/profile
📧MailEmail
🔔BellNotifications
🌙MoonDark mode
☀️SunLight mode
🔗ExternalLinkExternal link
📋CopyCopy to clipboard

Styling Icons

Color

Icons inherit text color by default:

vue
<template>
  <Check class="h-4 w-4 text-green-500" />
  <X class="h-4 w-4 text-destructive" />
  <Info class="h-4 w-4 text-muted-foreground" />
</template>

Stroke Width

Lucide icons accept a stroke-width prop:

vue
<template>
  <Check class="h-4 w-4" :stroke-width="1.5" />
  <Check class="h-4 w-4" :stroke-width="2" />
  <Check class="h-4 w-4" :stroke-width="3" />
</template>

Animation

vue
<template>
  <!-- Spinning loader -->
  <Loader2 class="h-4 w-4 animate-spin" />
  
  <!-- Pulsing notification -->
  <Bell class="h-4 w-4 animate-pulse" />
</template>

Accessibility

Always provide accessible labels for icon-only buttons:

vue
<template>
  <!-- Screen reader only text -->
  <Button variant="ghost" size="icon">
    <X class="h-4 w-4" />
    <span class="sr-only">Close dialog</span>
  </Button>
  
  <!-- Or use aria-label -->
  <Button variant="ghost" size="icon" aria-label="Close dialog">
    <X class="h-4 w-4" />
  </Button>
</template>

Browse All Icons

Explore all available icons at lucide.dev/icons.