FilamentF
Filament16mo ago
CGM

How to add NPM added assets to Filament.

I'm getting a little lost in the docs on this one.

I'm looking to integrate https://swiperjs.com/ into a project and want to include the sources (js/css) in my project using NPM.

$ npm install swiper

Could anyone point me in the right direction as to what to do next to ensure the proper imports happen when the field is loaded?

How do I access the assets added using NPM in my field and then how/where do I import?

// import Swiper bundle with all modules installed
import Swiper from 'swiper/bundle';

// import styles bundle
import 'swiper/css/bundle';
Swiper
Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior.
Was this page helpful?