Download the PHP package harvirsidhu/filament-action-overflow without Composer

On this page you can find all versions of the php package harvirsidhu/filament-action-overflow. 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 filament-action-overflow

Filament Action Overflow

Latest Version on Packagist Total Downloads

Turn a flat list of Filament actions into a few primary buttons + a tidy "More" dropdown — automatically.

You declare every action in one list. The package decides which ones sit out front and which get tucked under More, so crowded action rows stop wrapping and your UI stays clean.

Works anywhere Filament accepts an action array — page headers, table actions, record actions, bulk actions, widgets.


Contents


Why this package


Requirements

Requirement Version
PHP ^8.2
Filament ^4.0^5.0

Installation

That's it — the package auto-registers and works with zero configuration.

Only publish the config if you want to change the defaults globally:


Quick start (30 seconds)

Build an ActionGroup exactly as you normally would, then chain ->withOverflow() and return the result:

withOverflow(int $primary = 1) is terminal: it returns the finished array<Action|ActionGroup>, ready to hand straight back from getHeaderActions(), getTableActions(), getRecordActions(), getBulkActions(), and so on.

By default, the primary actions and the More trigger are rendered as buttons, so you get a row of matching buttons without sprinkling ->button() everywhere.


The two ways to use it

There are exactly two entry points. Pick based on whether you need to customize the More button.

->withOverflow() macro ActionOverflow facade
Best for The common case When you need control
Syntax Chains onto an existing ActionGroup Standalone builder
Customizes label / icon / color / position? No (only the primary count) Yes, full fluent API
Returns array (terminal) array via ->toActions() (terminal)

Macro — shortest path:

Facade — when you want to change the trigger or behavior:

Both produce the same kind of output — the macro is just sugar over the facade with primaryCount set.


How it decides what overflows

The whole package is one deterministic pipeline. Understanding it means you can always predict the output.

1. It filters first. Hidden, invisible, and (if you opt in) unauthorized actions are removed before anything else — including those nested inside divider sections. Only available actions are ever counted or placed.

2. It fills primary slots left-to-right. Walking your list in order, it promotes actions to the front until primaryCount is reached (default 1). Everything after that overflows. Order is preserved — the list order is the priority order.

3. It applies the count rule to whatever is left:

Available overflow actions Result
0 No More button at all — just the primary actions.
1 That single action is shown inline (promoted to a button), never hidden behind a dropdown for no reason.
2 or more Grouped under a single More dropdown.

4. It positions the More control at the end (default) or start of the row — see Put More on the left.

That's the entire model. Everything below is just configuring these steps.


Recipes

Choose how many primary actions

primaryCount controls how many actions stay out front. The rest overflow.

primaryCount(0) is valid and pushes everything into More. Negative values throw an InvalidArgumentException.

Style the More trigger

Only available via the facade (the macro intentionally keeps its surface tiny):

Put More on the left (and RTL)

By default the More control sits after the primary actions. Use MorePosition::Start to put it first:

This is the right answer to "how do I support RTL?" — there's nothing extra to do. The package only reorders the array, and Filament renders that array in the reading direction. So Start means the reading start: it lands on the left in LTR and automatically flips to the right under RTL. Use Start/End (logical) rather than thinking left/right (physical), and direction handling is free.

The position applies to the flattened single-action case too, not just the grouped More trigger.

Sections inside the menu (dividers)

A dropdown(false) group nested inside an ActionGroup is Filament's idiom for "render these as a separated section." This package treats those as first-class and carries them into the More menu:

How dividers behave — predictable and lossless:

Hidden, invisible & unauthorized actions

Hidden and invisible actions are filtered automatically — they're gone before composition, so they can't sneak into More:

Authorization filtering is opt-in, because Filament's renderer already disables unauthorized actions visually. Enable it when you'd rather drop them entirely:

Button vs. link appearance

By default, primary actions and the More trigger are promoted to button view so the row looks uniform. To leave each action's own render style untouched, opt out:

button(false) is opt-out only — it stops the composer from adding ->button(). An action you already styled with ->button() keeps its button view regardless.

Set defaults globally

Prefer to configure once instead of per-call? Publish the config and edit the defaults — every withOverflow() / ActionOverflow::make() call inherits them (and per-call methods still override per call):


API reference

ActionGroup::withOverflow() macro

Terminal. Composes the group's actions with the given primary count, using config defaults for everything else. Returns the finished action array.

ActionOverflow fluent API

Every method returns $this for chaining; toActions() ends the chain and returns the array.

Method Default Description
make(array $actions) Start a builder from a flat action list.
primaryCount(int $count) 1 How many actions stay out front. 0 overflows everything; negatives throw.
label(string $label) 'More' The More trigger's text.
icon(string\|BackedEnum\|null $icon) ellipsis Trigger icon. String, backed enum, or Filament icon enum; null restores the default.
iconPosition(IconPosition\|string\|BackedEnum\|null $position) After 'before' / 'after' or an IconPosition enum.
color(string $color) 'gray' Any Filament color name for the trigger.
hiddenLabel(bool $state = true) false Icon-only trigger (where the Filament version supports it).
button(bool $state = true) true Promote primary actions + trigger to button view. false opts out.
morePosition(MorePosition\|string $position) End Place the More control at the Start or End of the row.
filterUnauthorized(bool $state = true) false Drop unauthorized actions before composing.
toActions() Terminal. Returns array<Action\|ActionGroup>.

MorePosition enum

Harvirsidhu\FilamentActionOverflow\Enums\MorePosition

Case String Meaning
Start 'start' Reading start — left in LTR, right in RTL.
End 'end' Reading end — right in LTR, left in RTL (default).

Config keys (config/action-overflow.php)

Key Type Default Maps to
primary_count int 1 primaryCount()
label string 'More' label()
icon string\|enum 'heroicon-m-ellipsis-vertical' icon()
icon_position string\|enum 'after' iconPosition()
color string 'gray' color()
hidden_label bool false hiddenLabel()
button bool true button()
more_position string\|enum 'end' morePosition()
filter_unauthorized bool false filterUnauthorized()

Defaults are stored as strings (not Filament enum constants) so the published file loads cleanly on both Filament 4 and 5. You may still pass enums at the call site.


Under the hood

For the curious, toActions() runs a fixed five-stage pipeline:

  1. Filter — remove hidden / invisible / (opt-in) unauthorized actions, recursing one level into divider groups and dropping any divider left empty.
  2. Partition — walk left-to-right, taking primaryCount real actions into primary; a divider contributes its children toward that count and re-wraps any leftovers as a divider in overflow.
  3. Promote — if button is on, call ->button() on the primary actions.
  4. Sanitize — unwrap a leading divider in the overflow so there's no orphan separator at the top of the menu.
  5. Assemble — count the available overflow actions and apply the 0 / 1 / 2+ rule, then place the result at the start or end per morePosition.

The package never renders HTML — it only restructures the action array and hands it back to Filament, which means it composes naturally with everything Filament already does (theming, RTL, authorization display, etc.).


FAQ

Why didn't a "More" button appear? You have one or zero overflow actions. A single leftover is shown inline by design; More appears only with two or more.

Why is one of my overflow actions a plain button instead of being in the dropdown? Same rule — when exactly one action overflows, it's surfaced inline rather than hidden behind a dropdown for a single item.

Do I need to do anything for RTL? No. Use morePosition(MorePosition::Start) for "leading side"; it flips automatically with the layout direction. See Put More on the left.

Can I use it outside page headers? Yes — the output is just an action array, valid anywhere Filament accepts one (tables, records, bulk actions, widgets).

An action's visibility depends on the record — is that respected? Yes. Filtering calls the same isHidden() / isVisible() / isAuthorized() your action defines, so record-aware closures are honored.


Testing

Changelog

See CHANGELOG for release notes.

Credits

License

MIT — see LICENSE.


All versions of filament-action-overflow with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^4.0 || ^5.0
spatie/laravel-package-tools Version ^1.15.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 harvirsidhu/filament-action-overflow contains the following files

Loading the files please wait ...