https://github.com/log1x/blade-filetype-icons
A package to easily make use of dmhendricks/file-icon-vectors in your Laravel Blade views.
https://github.com/log1x/blade-filetype-icons
blade filetypes icons laravel svg
Last synced: 12 months ago
JSON representation
A package to easily make use of dmhendricks/file-icon-vectors in your Laravel Blade views.
- Host: GitHub
- URL: https://github.com/log1x/blade-filetype-icons
- Owner: Log1x
- License: mit
- Created: 2023-08-22T05:56:19.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-15T10:38:15.000Z (about 2 years ago)
- Last Synced: 2024-10-29T13:55:50.406Z (over 1 year ago)
- Topics: blade, filetypes, icons, laravel, svg
- Language: PHP
- Homepage: https://github.com/Log1x/blade-filetype-icons
- Size: 1.02 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README

# Blade File Type Icons



A package to easily make use of [file-icon-vectors](https://github.com/dmhendricks/file-icon-vectors) by [Daniel Hendricks](https://github.com/dmhendricks) in your Laravel Blade views.
This package focuses on the `vivid` and `square-o` variations of `file-icon-vectors` as they are able to be made monochrome.
For a full list of available icons, see [the SVG directory](resources/svg) or the [original repo](https://github.com/dmhendricks/file-icon-vectors/tree/master/dist/icons).
## Requirements
- PHP 8.0 or higher
- Laravel 9.0 or higher
## Installation
```bash
$ composer require log1x/blade-filetype-icons
```
## Blade Icons
Blade File Type Icons uses Blade Icons under the hood. Please refer to [the Blade Icons readme](https://github.com/blade-ui-kit/blade-icons) for additional functionality. We also recommend to [enable icon caching](https://github.com/blade-ui-kit/blade-icons#caching) with this library.
## Configuration
Blade File Type Icons also offers the ability to use features from Blade Icons like default classes, default attributes, etc. If you'd like to configure these, publish the `blade-filetype-icons.php` config file:
```bash
php artisan vendor:publish --tag=blade-filetype-icons-config
```
## Usage
Icons can be used as self-closing Blade components which will be compiled to SVG icons:
```blade
```
You can also pass classes to your icon components:
```blade
```
And even use inline styles:
```blade
```
Or use the `@svg` directive:
```blade
@svg('filetype-v-exe', 'w-6 h-6', ['style' => 'color: #555'])
```
The square-o icons can be referenced like this:
```blade
```
### Raw SVG Icons
If you want to use the raw SVG icons as assets, you can publish them using:
```bash
php artisan vendor:publish --tag=blade-filetype-icons --force
```
Then use them in your views like:
```blade
```
## Bug Reports
If you discover a bug in Blade File Type Icons, please [open an issue](https://github.com/Log1x/blade-filetype-icons/issues).
## Contributing
Contributing whether it be through PRs, reporting an issue, or suggesting an idea is encouraged and appreciated.
## License
Blade File Type Icons is provided under the [MIT License](LICENSE.md).