Skip to content

useIcons

Override the icon set used internally across every component.

Every internal icon this library renders itself - a button's loading spinner, a chip's remove glyph, a select's dropdown chevron, a toast's success/danger icon, and so on - resolves from one semantic-purpose registry, useIcons(), rather than being hardcoded per component. name props you set yourself (SButton's icon, SInput's icon, ...) are unaffected - this registry is only for icons a component renders on its own.

Usage

Override any key globally in app.config.ts:

ts
export default defineAppConfig({
  selaras: {
    icons: {
      close: 'lucide:x',
      loading: 'lucide:loader-2',
    },
  },
})

Only the keys you set are overridden; everything else keeps its Hugeicons default. This changes every component that uses that key at once - setting close reskins the dismiss icon on Modal, Toast, Input's clear button, and Chip's remove button all together, rather than needing a separate override for each.

Registry

KeyDefaultUsed by
closehugeicons:cancel-01Modal, Toast, Chip, Input's clear button, CommandPalette
checkhugeicons:tick-02Checkbox, Select's selected-item marker
indeterminatehugeicons:minus-signCheckbox's indeterminate state
chevronUphugeicons:arrow-up-01Accordion, InputNumber's stepper
chevronDownhugeicons:arrow-down-01Select, Autocomplete, DatePicker, InputNumber's stepper
chevronRighthugeicons:arrow-right-01Tree, NavigationMenu
chevronLefthugeicons:arrow-left-01Pagination, DatePicker's month nav
chevronsLefthugeicons:previousPagination's first-page control
chevronsRighthugeicons:nextPagination's last-page control
loadinghugeicons:loading-02Button/Switch's loading spinner
searchhugeicons:search-01CommandPalette, Autocomplete
sortUnsortedhugeicons:sorting-05Table's sortable column headers when not sorted
sortAscendinghugeicons:arrow-up-02Table's ascending sort state
sortDescendinghugeicons:arrow-down-02Table's descending sort state
filterhugeicons:filterTable column filter trigger
columnshugeicons:table-columns-splitTable's column-toggle control
copyhugeicons:copyCodeButton
lightModehugeicons:sun-01ColorModeToggle
darkModehugeicons:moonColorModeToggle
calendarhugeicons:calendar-01DatePicker
clockhugeicons:clock-01DatePicker's time picker
plushugeicons:plus-signInputNumber's stepper
minushugeicons:minus-signInputNumber's stepper
successhugeicons:checkmark-circle-01Toast, Alert
dangerhugeicons:cancel-circleToast, Alert
warninghugeicons:alert-circleToast, Alert
infohugeicons:information-circleToast, Alert
userhugeicons:userAvatar's fallback
maximizehugeicons:fullscreenModal's fullscreen toggle
minimizehugeicons:collapseModal's fullscreen toggle
starhugeicons:starRating
uploadhugeicons:upload-01FileUpload
filehugeicons:file-01FileUpload, FileTree
folderhugeicons:folder-01FileTree
folderOpenhugeicons:folder-openFileTree
morehugeicons:more-horizontalTable's row-actions trigger
sidebarCollapsehugeicons:sidebar-left-01DashboardSidebarToggle

API

ts
function useIcons(): ComputedRef<IconRegistry>

Returns the merged registry (your app.config.selaras.icons overrides applied on top of the Hugeicons defaults above) - use this if you're building your own component and want it to respect the same overrides a consumer already set, instead of hardcoding an icon name directly:

vue
<script setup lang="ts">
const icons = useIcons()
</script>

<template>
  <SIcon :name="icons.close" />
</template>
Edit this page