PHPackages                             ptplugins/filament-collapsible-column-group - 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. ptplugins/filament-collapsible-column-group

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ptplugins/filament-collapsible-column-group
===========================================

Collapsible (expand/collapse) column groups for FilamentPHP tables — v3, v4, and v5. Click a group header to fold the columns it spans into a thin placeholder; the collapsed state persists across Livewire updates.

1.0.1(1mo ago)1113MITPHPPHP ^8.1

Since Jun 23Pushed 1mo agoCompare

[ Source](https://github.com/ptplugins/filament-collapsible-column-group)[ Packagist](https://packagist.org/packages/ptplugins/filament-collapsible-column-group)[ Docs](https://ptplugins.com/filament-collapsible-column-group)[ RSS](/packages/ptplugins-filament-collapsible-column-group/feed)WikiDiscussions main Synced 2w ago

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

Filament Collapsible Column Group
=================================

[](#filament-collapsible-column-group)

 [![Filament Collapsible Column Group — fold the columns a group header spans into a thin placeholder](./screenshot.png)](./screenshot.png)

> Collapsible (expand/collapse) **column groups** for [FilamentPHP](https://filamentphp.com/) tables — **v3, v4, and v5**. Click a group header and the columns it spans fold away into a thin placeholder; click again to bring them back.

Wide tables with logically grouped columns (e.g. *Q1 / Q2 / Q3 / Q4*, or *Address*, *Contact*, *Billing*) get unreadable fast. This package turns any Filament `ColumnGroup` header into a toggle that collapses everything under it, so users can focus on the groups they care about. The collapsed state is remembered and survives sorting, filtering and pagination.

Single codebase across all three Filament major versions — same class, same API.

 [![Buy us a beer](https://camo.githubusercontent.com/1bef23d3b523a63534746f730a172d71f7bc0f925da66b491b6997a778c7777c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2546302539462538442542412d427579253230757325323061253230626565722d79656c6c6f77)](https://ptplugins.com/buy-us-a-beer)

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

[](#installation)

```
composer require ptplugins/filament-collapsible-column-group
```

The package auto-discovers its service provider and registers its own JS/CSS through `FilamentAsset`. There is nothing to publish.

Quick start
-----------

[](#quick-start)

Swap Filament's `ColumnGroup` for `CollapsibleColumnGroup` and call `->collapsible()`:

```
use PtPlugins\FilamentCollapsibleColumnGroup\CollapsibleColumnGroup;
use Filament\Tables\Columns\TextColumn;

public function table(Table $table): Table
{
    return $table->columns([
        TextColumn::make('name'),

        CollapsibleColumnGroup::make('Q1')
            ->collapsible()
            ->columns([
                TextColumn::make('jan'),
                TextColumn::make('feb'),
                TextColumn::make('mar'),
            ]),

        CollapsibleColumnGroup::make('Q2')
            ->collapsible(collapsedByDefault: true) // starts folded
            ->columns([
                TextColumn::make('apr'),
                TextColumn::make('may'),
                TextColumn::make('jun'),
            ]),
    ]);
}
```

That's it. Each collapsible group header shows a `−` (expanded) or `+` (collapsed) icon; clicking it folds the columns it spans into a single thin placeholder cell so the row layout stays intact.

API
---

[](#api)

MethodDefaultDescription`collapsible(bool $collapsible = true, bool $collapsedByDefault = false)`—Makes the group header a collapse/expand toggle. Pass `collapsedByDefault: true` to render it folded on first load.`CollapsibleColumnGroup` **extends Filament's `ColumnGroup`**, so everything you already do with a column group keeps working — `->columns([...])`, `->alignment()`, `->wrapHeader()`, and so on. `collapsible()` is purely additive; a group without it behaves exactly like a normal `ColumnGroup`.

How it works
------------

[](#how-it-works)

The PHP class is a thin annotator. When a group is `collapsible()` it:

- prepends a `+`/`−` icon to the group label, and
- tags the group header `` with `data-collapsible-group` and `data-collapsed-default` via `extraHeaderAttributes()`.

All behaviour lives in the bundled JS:

- A single delegated click handler toggles the group: it shrinks the header's `colspan`, hides the body cells the group spans (keeping the first one as a `2rem` placeholder so columns stay aligned), and flips the icon.
- The collapsed/expanded state is stored per group in `sessionStorage` and re-applied on a Livewire `commit` hook, so it **persists across sorting, filtering, pagination and any other Livewire re-render**.

Because it only touches the public `ColumnGroup` API plus its own `data-*` hooks — never Filament's internal markup or CSS classes — the exact same code runs on Filament v3, v4 and v5 (Livewire 3 and 4).

Notes &amp; gotchas
-------------------

[](#notes--gotchas)

- **Group state keys off the label.** Persistence uses a slug of the group label, so give collapsible groups in the same table distinct labels (two groups both labelled "Total" would share one collapsed state).
- **Toggling is pure front-end.** Collapsing never hits the server — it's instant and does not re-query. Only the persisted state is re-applied after Livewire updates.
- **It folds columns, not data.** Collapsed columns are hidden in the DOM, not removed from the query. Exports, summaries and totals are unaffected.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Filament 3.x, 4.x, or 5.x

License
-------

[](#license)

MIT — see [LICENSE.md](LICENSE.md).

---

Part of the [ptplugins.com](https://ptplugins.com) collection of FilamentPHP plugins.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance90

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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 ~0 days

Total

2

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58f7e578abcf85b80036e2d54969fe0926997218a40aff6b517dd26fa38fdba9?d=identicon)[Premke](/maintainers/Premke)

---

Top Contributors

[![Premke](https://avatars.githubusercontent.com/u/1667836?v=4)](https://github.com/Premke "Premke (2 commits)")

---

Tags

laraveluitablefilamentfilamentphpcolumnscollapsiblecolumn-groupexpand-collapse

### Embed Badge

![Health badge](/badges/ptplugins-filament-collapsible-column-group/health.svg)

```
[![Health](https://phpackages.com/badges/ptplugins-filament-collapsible-column-group/health.svg)](https://phpackages.com/packages/ptplugins-filament-collapsible-column-group)
```

###  Alternatives

[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6758.2k2](/packages/marcelweidum-filament-passkeys)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

85240.3k9](/packages/stephenjude-filament-two-factor-authentication)[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

16461.2k](/packages/relaticle-custom-fields)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.8k](/packages/rawilk-profile-filament-plugin)[backstage/mails

View logged mails and events in a beautiful Filament UI.

16321.5k](/packages/backstage-mails)[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

128216.0k3](/packages/dotswan-filament-map-picker)

PHPackages © 2026

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