PHPackages                             infinityloop-dev/lazy-component - 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. [Framework](/categories/framework)
4. /
5. infinityloop-dev/lazy-component

ActiveLibrary[Framework](/categories/framework)

infinityloop-dev/lazy-component
===============================

Component for Nette framwork which helps with creation of lazy ajax loaded components.

v1.1.1(6y ago)4567MITPHPPHP &gt;=7.4

Since Jan 22Pushed 6y ago2 watchersCompare

[ Source](https://github.com/infinityloop-dev/lazy-component)[ Packagist](https://packagist.org/packages/infinityloop-dev/lazy-component)[ Docs](https://www.infinityloop.dev/)[ RSS](/packages/infinityloop-dev-lazy-component/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Lazy component
==============

[](#lazy-component)

🔧 Component for Nette framwork which helps with creation of lazy ajax loaded components.

Introduction
------------

[](#introduction)

Component which renders empty in the beggining and is populated by signal request.

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

[](#installation)

Install package using composer

```
composer require infinityloop-dev/lazy-component

```

Dependencies
------------

[](#dependencies)

- PHP &gt;= 7.4
- [nette/application](https://github.com/nette/application)
- [nette/utils](https://github.com/nette/utils)

How to use
----------

[](#how-to-use)

- Create new component and extend `\Infinityloop\LazyComponent\LazyComponent` instead of `\Nette\Application\UI\Control`.
- Trigger `handleLoadComponent` to load and redraw component.
- Use macro `{control componentName}` to render your component as you would normally.
- Additionaly use `{control componentName:loadComponentLink}` to get URL for `loadComponent` signal.
    - Useful for rendering URL (eg. into data attributes) so you can easily trigger signal from javascript.
- Make sure `LazyCompoennt::render()` method is called if you choose to override it.
    - Preferably use `beforeRender()` to pass variables into template.
    - `beforeRender()` method is not called when empty template is used (when component is not loaded).
- Template for your component is automaticaly deduced to be have same name (and path) as your `.php` file.
    - File extension is simply swapped to `.latte`.
- By default the FontAwesome 5 spinner is used as placeholder. Override `EMPTY_TEMPLATE` constant to use different empty template file.

### Example lazy tab content

[](#example-lazy-tab-content)

Tab header:

```
Tab name

```

Tab content:

```

    {control myComponent}

```

JQuery ajax request on click:

```
$(".tab[data-load-component]").one('click',function (event) {
    const link = $(this).data("load-component");
    $.nette.ajax({
        method: 'GET',
        url: link,
    });
});

```

- Load event is executed only once ([jqery.one](https://api.jquery.com/one/)).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Total

3

Last Release

2268d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00654c913028f8d25a226eb2ddf368e1b999bf72fa4f77dbd1449c1df218756c?d=identicon)[peldax](/maintainers/peldax)

---

Top Contributors

[![peldax](https://avatars.githubusercontent.com/u/10790033?v=4)](https://github.com/peldax "peldax (24 commits)")

---

Tags

componentlazy-loadingnettenette-componentphp

### Embed Badge

![Health badge](/badges/infinityloop-dev-lazy-component/health.svg)

```
[![Health](https://phpackages.com/badges/infinityloop-dev-lazy-component/health.svg)](https://phpackages.com/packages/infinityloop-dev-lazy-component)
```

###  Alternatives

[nette/nette

👪 Nette Framework - innovative framework for fast and easy development of secured web applications in PHP (metapackage)

1.6k2.8M335](/packages/nette-nette)[nasext/dependent-select-box

Dependent Select Box for Nette Framework.

21262.8k2](/packages/nasext-dependent-select-box)[o5/grido

Grido - DataGrid for Nette Framework

87290.5k4](/packages/o5-grido)[nette/web-project

Nette: Standard Web Project

10991.8k](/packages/nette-web-project)[kdyby/autowired

Syntax sugar for working with services in Nette Framework

30885.7k9](/packages/kdyby-autowired)[adamstipak/nette-rest-route

Rest route for Nette Framework

67150.8k](/packages/adamstipak-nette-rest-route)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
