charlieetienne/filament-font-picker
A beautiful Google Fonts picker component for Filament forms with real-time font previews, search functionality, and category filtering.
You can install the package via composer:
composer require charlieetienne/filament-font-picker
[!IMPORTANT] If you have not set up a custom theme and are using Filament Panels follow the instructions in the Filament Docs first.
After setting up a custom theme add the plugin's views to your theme css file or your app's css file if using the standalone packages.
@source '../../../../vendor/charlieetienne/filament-font-picker/resources/**/*.blade.php';
Use the FontPicker component in your Filament forms:
use CharlieEtienne\FilamentFontPicker\FontPicker;
FontPicker::make('font')
->label('Choose Font')
You can control which font categories are available and which are preselected:
Limit which categories are shown (restricts the available options):
FontPicker::make('font')
->availableCategories([
'serif',
'sans-serif',
'monospace',
'display',
'handwriting',
])
Preselect certain categories when the component loads (users can still change them):
FontPicker::make('font')
->selectedCategories([
'monospace',
'handwriting',
])
You can customize all these options:
FontPicker::make('font')
->placeholder('Select a font')
->searchPrompt('Search fonts')
->previewText('The quick brown fox jumps over the lazy dog')
->noResultsTitle('No fonts found matching')
->noResultsSubtitle('Try searching for serif, sans-serif, monospace, or display fonts')
->loadingMessage('Loading Google Fonts...')
->loadingPreviewMessage('Loading preview...')
The package includes a built-in Google Fonts dataset that works out of the box.
However, if you want to update the fonts data or need the latest fonts from Google, you'll need to configure a Google Fonts API key.
.env file:
GOOGLE_FONTS_API_KEY=your_api_key_here
php artisan filament-font-picker:update-fonts
This command will fetch the latest fonts from Google and update the list of available fonts.Contributions are welcome! Please feel free to submit a Pull Request.
The MIT License (MIT). Please see License File for more information.
How can I help you explore Laravel packages today?