Skip to content
Bladewell

<x-widget.icon>

Icon Blade component for Laravel and Livewire

Small SVG icons, drawn inline: arrows and chevrons, mail, phone, home, settings, bell, users, search, calendar, file, upload and download, and more. Pass a name; size and colour come from classes.

php artisan bladewell:add icon
Also adds
Nothing else. It stands alone.
Used by
Accordion, Alert, Breadcrumbs, Button, Calendar, Captcha, Chat, Checkbox, Clock, Command palette, Date range picker, Date picker, Dropdown, Field, File upload, Image cropper, Modal, Number, Pagination, Password, Phone, Popover, Repeater, Search, Select, Sidebar layout, Sortable list, Stepper, Switch, Table, Tabs, Tags input, Text input, Time picker, Tooltip, Tooltip cursor, Tree
Works with
Laravel 12 and 13, Livewire 3 and 4, Tailwind CSS 4.1+, PHP 8.3+
Guides
Real-time notification bell with Laravel Reverb · Laravel Blade card, avatar and empty state patterns

Usage

With blade icons

Need an icon the set doesn't have? With Blade Icons (blade-ui-kit/blade-icons) and one of its sets installed, give its name anywhere a widget takes an icon: the button, dropdown items, inputs, tabs and the rest. It's drawn with the same classes and screen-reader handling as the built-in icons. Built-in names still win, and an unknown name still fails loudly.

Blade
{{-- composer require blade-ui-kit/blade-icons mallardduck/blade-lucide-icons (or another Blade Icons set: heroicon-o-…, tabler-…) --}}
<x-widget.button icon-start="lucide-rocket">Launch</x-widget.button>

<x-widget.dropdown label="More">
    <x-widget.dropdown.item icon="lucide-zap">Boost</x-widget.dropdown.item>
</x-widget.dropdown>

<x-widget.icon name="lucide-party-popper" class="size-5" />

Examples

Basic

Icons are hidden from screen readers unless you give them a label.

Show code
Blade
<div class="text-foreground flex items-center gap-4">
    <x-widget.icon name="wallet" class="size-4" />
    <x-widget.icon name="calendar" class="size-5" />
    <x-widget.icon name="shield-check" class="text-primary size-6" />
    <x-widget.icon name="circle-alert" class="text-error size-8" />
</div>

All icons

Every icon in the set, by the name you pass. To add one, draw it in resources/views/widget/icon/index.blade.php.

  • archive
  • arrow-down
  • arrow-left
  • arrow-right
  • arrow-up
  • at-sign
  • banknote
  • bell
  • bell-off
  • bookmark
  • calendar
  • calendar-days
  • calendar-range
  • camera
  • chart-bar
  • check
  • chevron-down
  • chevron-left
  • chevron-right
  • chevron-up
  • chevrons-left
  • chevrons-right
  • chevrons-up-down
  • circle-alert
  • circle-check
  • circle-help
  • circle-x
  • clipboard
  • clock
  • coins
  • copy
  • credit-card
  • database
  • download
  • ellipsis
  • external-link
  • eye
  • eye-off
  • file
  • file-text
  • filter
  • folder
  • folder-open
  • gift
  • globe
  • grip-vertical
  • headphones
  • heart
  • home
  • image
  • inbox
  • info
  • key
  • layout-dashboard
  • link
  • list
  • lock
  • log-in
  • log-out
  • mail
  • map-pin
  • megaphone
  • menu
  • message-circle
  • mic
  • minus
  • moon
  • music
  • package
  • panel-left
  • paperclip
  • pause
  • pencil
  • percent
  • phone
  • play
  • plus
  • printer
  • receipt
  • redo
  • refresh-cw
  • rotate-ccw
  • rss
  • save
  • scissors
  • search
  • send
  • settings
  • share
  • shield-check
  • shopping-bag
  • shopping-cart
  • star
  • store
  • sun
  • tag
  • thumbs-up
  • trash
  • triangle-alert
  • truck
  • undo
  • upload
  • user
  • user-plus
  • users
  • video
  • volume-2
  • wallet
  • x
Show code
Blade
<ul class="grid grid-cols-[repeat(auto-fill,minmax(7.5rem,1fr))] gap-2">
    @foreach (['archive', 'arrow-down', 'arrow-left', 'arrow-right', 'arrow-up', 'at-sign', 'banknote', 'bell', 'bell-off', 'bookmark', 'calendar', 'calendar-days', 'calendar-range', 'camera', 'chart-bar', 'check', 'chevron-down', 'chevron-left', 'chevron-right', 'chevron-up', 'chevrons-left', 'chevrons-right', 'chevrons-up-down', 'circle-alert', 'circle-check', 'circle-help', 'circle-x', 'clipboard', 'clock', 'coins', 'copy', 'credit-card', 'database', 'download', 'ellipsis', 'external-link', 'eye', 'eye-off', 'file', 'file-text', 'filter', 'folder', 'folder-open', 'gift', 'globe', 'grip-vertical', 'headphones', 'heart', 'home', 'image', 'inbox', 'info', 'key', 'layout-dashboard', 'link', 'list', 'lock', 'log-in', 'log-out', 'mail', 'map-pin', 'megaphone', 'menu', 'message-circle', 'mic', 'minus', 'moon', 'music', 'package', 'panel-left', 'paperclip', 'pause', 'pencil', 'percent', 'phone', 'play', 'plus', 'printer', 'receipt', 'redo', 'refresh-cw', 'rotate-ccw', 'rss', 'save', 'scissors', 'search', 'send', 'settings', 'share', 'shield-check', 'shopping-bag', 'shopping-cart', 'star', 'store', 'sun', 'tag', 'thumbs-up', 'trash', 'triangle-alert', 'truck', 'undo', 'upload', 'user', 'user-plus', 'users', 'video', 'volume-2', 'wallet', 'x'] as $name)
        <li class="border-line text-foreground flex flex-col items-center gap-2 rounded-md border px-2 py-4">
            <x-widget.icon :name="$name" class="size-6" />
            <span class="text-muted font-mono text-xs">{{ $name }}</span>
        </li>
    @endforeach
</ul>

Props

Other attributes, such as autocomplete or data-*, are passed through to the element. class styles the component's outer wrapper.

<x-widget.icon>

Prop Default Description
name Required One of: archive, arrow-down, arrow-left, arrow-right, arrow-up, at-sign, banknote, bell, bell-off, bookmark, calendar, calendar-days, calendar-range, camera, chart-bar, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-left, chevrons-right, chevrons-up-down, circle-alert, circle-check, circle-help, circle-x, clipboard, clock, coins, copy, credit-card, database, download, ellipsis, external-link, eye, eye-off, file, file-text, filter, folder, folder-open, gift, globe, grip-vertical, headphones, heart, home, image, inbox, info, key, layout-dashboard, link, list, lock, log-in, log-out, mail, map-pin, megaphone, menu, message-circle, mic, minus, moon, music, package, panel-left, paperclip, pause, pencil, percent, phone, play, plus, printer, receipt, redo, refresh-cw, rotate-ccw, rss, save, scissors, search, send, settings, share, shield-check, shopping-bag, shopping-cart, star, store, sun, tag, thumbs-up, trash, triangle-alert, truck, undo, upload, user, user-plus, users, video, volume-2, wallet, x. Any other name is drawn by Blade Icons (blade-ui-kit/blade-icons) if the app has it, e.g. lucide-rocket or heroicon-o-bolt, and otherwise throws, listing these. To add one of your own, draw it into $icons below.

Accessibility

All 2 examples above are checked with axe-core against the WCAG 2.2 A and AA rules, in the light theme and the dark one, both as the page draws and with each popover, dialog, toast and tooltip opened, on every change. A change that fails can't be merged. Where axe can't decide, such as contrast on SVG text, the test measures the colours itself instead of letting it pass.

Automated checks can't judge everything: how it sounds in a screen reader, and how it feels to use from the keyboard, still need a person. Check those on your own pages too.

Source

What bladewell:add icon writes to your app with the default namespaces. Prefer to copy by hand? Take these files, plus the ones from the components it also adds , and the theme and base CSS.

resources/views/components/widget/icon/index.blade.php Show
index.blade.php