Download the PHP package visual1/statamic-font-awesome-fieldtype without Composer

On this page you can find all versions of the php package visual1/statamic-font-awesome-fieldtype. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package statamic-font-awesome-fieldtype

Font Awesome Fieldtype for Statamic

Statamic Font Awesome

A Font Awesome fieldtype for Statamic that provides a searchable icon interface with visual color and size controls. Supports both Font Awesome Free and Pro with automatic fallback.

✨ Features

🔍 Smart Search & Performance

🎨 Rich User Experience

🔐 Pro & Free Support

⚡ Developer Experience

📦 Installation

Via Composer from GitHub

Add this repository to your composer.json:

Then run:

Manual Installation

  1. Clone or download from GitHub
  2. Extract to packages/visual1/font-awesome-fieldtype/
  3. Add to your main composer.json autoload section:

  4. Run composer dump-autoload

⚙️ Configuration

Basic Setup

The fieldtype works immediately after installation with Font Awesome Free. No configuration required!

Pro Setup (Optional)

For Font Awesome Pro features, add your credentials to .env:

Get your credentials from:

Publish Configuration (Optional)

This creates config/fontawesome.php for advanced customization.

🎯 Usage

1. Add to Blueprint

2. Fieldtype Configuration

Option Type Default Description
icon_styles Array ['solid'] Icon styles to include (solid, regular, light, thin, duotone, brands)
show_preview Boolean true Enable live icon preview in dropdown and preview area
hide_unavailable Boolean true Hide icons not available in current Font Awesome setup
placeholder String 'Search Font Awesome icons...' Custom placeholder text for search field

3. Add Font Awesome to Your Layout

Add this line to your layout file (resources/views/layout.antlers.html) in the <head> section:

Complete example:

4. Template Usage

Recommended Icon Rendering

Use this recommended syntax that handles both simple icons and icons with color/size settings:

Important: Replace my_icon with your actual field name. For example, if your field is called header_icon, use:

This conditional approach:

Note: The fieldtype preview will automatically show this syntax with your actual field name. Simply copy and paste it for error-free usage.

Simple Usage (Use with Caution)

For simple string-only icons (no color/size):

⚠️ Warning: This simple syntax will cause errors if the field contains color/size data. Always prefer the bulletproof conditional syntax above.

Advanced Usage

Direct HTML Usage

📊 Available Icon Styles

Style Class Availability Description
Solid fas Free & Pro Bold, filled icons
Regular far Free & Pro Outlined icons
Light fal Pro Only Lighter weight icons
Thin fat Pro Only Thinnest weight icons
Duotone fad Pro Only Two-color icons
Brands fab Free & Pro Brand and logo icons

🔧 API Integration

Font Awesome Pro API

The addon uses the official Font Awesome Pro GraphQL API for authenticated users:

Font Awesome Free API

For free users, icons are loaded from the GitHub metadata:

🚀 Performance Features

Search-Based Lazy Loading

Instead of loading 3,800+ icons upfront, the fieldtype uses intelligent lazy loading:

Caching Strategy

  1. Popular Icons Cache - 25 most common icons always available
  2. Full Icon Cache - Complete icon set cached for 30 minutes
  3. Search Cache - Individual search queries cached for 10 minutes
  4. Status Cache - Icon availability status cached for session
  5. Style Support Cache - CSS style detection cached for session

Performance Benefits

🎨 Customization

CSS Customization

The fieldtype uses Tailwind CSS classes and provides CSS custom properties for theming:

Dark Mode

Dark mode is automatically supported and follows your Control Panel theme:

🔍 Troubleshooting

Common Issues

Icons Not Loading

Problem: Icons don't appear in search results Solution:

  1. Check your API token in .env
  2. Verify network connectivity
  3. Clear the addon cache with the refresh button

Pro Icons Showing as Unavailable

Problem: Pro icons show as "PRO" or unavailable Solutions:

  1. Add FONTAWESOME_API_TOKEN to your .env file
  2. Verify your Pro subscription is active
  3. Check that your API token has correct permissions

Icons Not Rendering on Frontend

Problem: Icons show as squares or don't appear Solutions:

  1. Ensure Font Awesome CSS is loaded on your frontend
  2. For Pro users, add your Kit ID to .env
  3. Verify CSS classes are correct in templates

Cache Issues

To clear all caches, use the refresh button in the fieldtype interface or manually clear:

🔧 Advanced Configuration

Custom Icon Sets

While this addon focuses on Font Awesome, you can extend it for custom icon sets:

Performance Tuning

For high-traffic sites, consider these optimizations:

📚 API Reference

Fieldtype Methods

Antlers Tags

JavaScript Events

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

Testing

📄 License

This addon is proprietary software. See LICENSE for details.

🆘 Support

🎉 Credits

Created with ❤️ by Visual1


Made with ❤️ for the Statamic community

All versions of statamic-font-awesome-fieldtype with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
statamic/cms Version ^4.0 || ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package visual1/statamic-font-awesome-fieldtype contains the following files

Loading the files please wait ...