PHPackages                             femundfilou/kirby-asset-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. femundfilou/kirby-asset-manager

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

femundfilou/kirby-asset-manager
===============================

Add CSS and JS per (block) snippet

1.1.1(10mo ago)22.0k↑100%MITPHP

Since Nov 5Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/femundfilou/kirby-asset-manager)[ Packagist](https://packagist.org/packages/femundfilou/kirby-asset-manager)[ Docs](https://github.com/femundfilou/kirby-asset-manager)[ RSS](/packages/femundfilou-kirby-asset-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (6)Used By (0)

Kirby Asset Manager – Add CSS and JS per (block) snippet
========================================================

[](#kirby-asset-manager--add-css-and-js-per-block-snippet)

This plugin for [Kirby CMS](https://getkirby.com) is designed to streamline your website's performance by loading only what's needed. Keep your page weight in check and ensure fast loading times by registering stylesheets and JavaScript files on a per-snippet or block basis. Only include assets, that are actually used.

Installation
------------

[](#installation)

### Download

[](#download)

Download and copy this repository to `/site/plugins/asset-manager`.

### Git submodule

[](#git-submodule)

```
git submodule add https://github.com/femundfilou/kirby-asset-manager.git site/plugins/asset-manager

```

### Composer

[](#composer)

```
composer require femundfilou/kirby-asset-manager

```

Usage
-----

[](#usage)

This plugin exposes `$assetManager` to all snippets. With a simple command you can link a stylesheet or javascript file directly within your snippet. It does work for blocks, too.

```
// site/snippets/blocks/card.php
