Download the PHP package power-components/partials without Composer

On this page you can find all versions of the php package power-components/partials. 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 partials

Livewire Partials

Livewire Partials provide a structured and explicit way to update specific DOM fragments of a Livewire component instead of re-rendering the entire component tree. This is especially useful for complex components such as data tables, where partial updates significantly improve performance and user experience.

🔥 Performance Impact

Rendering a table with 100 rows - Payload Size Comparison:

Real-World Benefits

Metric Standard Livewire With Partials Improvement
Payload Size ~18.5 KB ~4.2 KB 77% smaller
Network Transfer Full component HTML Only updated fragment 60-80% less data
Response Time ~45-65 ms ~25-35 ms 40% faster
DOM Updates Entire component morphed Targeted elements only Minimal reflow
User Experience Input focus lost, scroll jumps Focus preserved, smooth updates Better UX

💡 For a table with 1,000 rows, the savings are even more dramatic: ~180 KB → ~8 KB (95% reduction)


Requirements


Installation


JavaScript Setup

Import the package JavaScript once in your application entrypoint.

resources/js/app.js


Configuration

You may disable partial rendering globally via environment configuration.

.env

When disabled, Livewire behaves exactly as usual and no partial payloads are generated.


Core Concepts

What Is a Partial

A partial is a named DOM fragment explicitly marked for selective updates. Only the HTML associated with that fragment is re-rendered and sent to the frontend.

Partials are identified by a unique name and mapped to a view or raw HTML.


View Structure

Partials work best when you extract your DOM regions into separate Blade files or components. This allows you to reuse the same view for both the initial render and subsequent partial updates.

resources/views/components/table/index.blade.php

Understanding $this vs $__partial

When a component is rendered normally (initial page load or full Livewire update), the $this variable refers to the Livewire component instance.

However, during a partial update, the partial is rendered in isolation, and the package automatically injects the component instance into a variable named $__partial.

To make your sub-views (partials) compatible with both scenarios, you should:

  1. Accept a __partial attribute in your Blade components (using @props).
  2. Pass :__partial="$this" when including them in the main view.
  3. Use $__partial inside the sub-view to access the component.

resources/views/components/table/tbody.blade.php


Component Usage

Registering Partials Manually

Use the partials() helper to register one or more partials during a component action.

The component instance is automatically available inside partial views as $__partial.


Attribute-Based Partial Rendering

For simple scenarios, partials can be registered declaratively using the PartialRender attribute.

When the method is executed, the specified view is automatically rendered and dispatched as a partial update.


Ignoring Elements (Preserving State)

You may exclude specific elements from being re-rendered during partial updates using wire:partial.ignore. This is particularly useful for elements that maintain their own internal state (like Alpine.js components, checkboxes, or focus) that would otherwise be lost if the element's HTML were replaced.

Key Usage

This directive must be used on an element that is inside a wire:partial block.

For it to work correctly, the element must have a unique identification (key). The package attempts to automatically identify it via wire:key or id attributes. If neither is present, you must provide a custom key directly in the directive.

Using explicit keys (e.g., wire:partial.ignore="my-key") is the best practice as it makes the relationship between the ignored element and its state more predictable and robust.

How it works

  1. Backend: The package detects the wire:partial.ignore directive and replaces the element's content with a lightweight placeholder (<!--PARTIAL:IGNORE:key-->).
  2. Frontend: Before applying the update, the JavaScript bridge captures the current innerHTML of the ignored element.
  3. Morphing: During the DOM morphing process, the ignored element itself is skipped (it's not updated), and its original content is restored if necessary.
  4. Preservation: Event listeners, local state, and Alpine.js data remain completely intact because the DOM element is never destroyed or replaced.

Credits

Dan Harrin proposed the original concept of the partials. The code for this package is based on the code he kindly shared with us.

Notice of Non-Affiliation and Disclaimer: Partials are not affiliated with, associated with, endorsed by, or in any way officially connected with the Laravel Livewire - copyright by Caleb Porzio. Laravel is a trademark of Taylor Otwell.


All versions of partials with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
livewire/livewire Version ^4.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 power-components/partials contains the following files

Loading the files please wait ...