Laravel pagination shows giant arrows or plain unstyled links
Pagination arrows fill the whole page widthShort answer
Laravel's default pagination views are written for Tailwind CSS. If your page loads Bootstrap or no Tailwind at all, the links render unstyled with huge arrow icons. Switch the paginator to the Bootstrap views in AppServiceProvider, make Tailwind scan the pagination views, or point links() at a view of your own.
Fix it fast
1Find out which cause you have
Open the page source and look at the markup that links() produced. Tailwind class names (flex, rounded-md, text-gray-700) mean the Tailwind view is in use. Then check which CSS framework your layout loads.
php artisan view:clear grep -rn "links()" resources/views | head grep -n "tailwindcss\|bootstrap" resources/css/app.css resources/views/layouts/*.blade.php2Match what you see, then jump to its fix
- 1
The HTML contains Tailwind classes, while your layout loads Bootstrap CSSThe app uses Bootstrap but the paginator still renders Tailwind markupFix - 2
The HTML has Tailwind classes but the page looks unstyledTailwind 4 never scans the pagination views, so its classes are not generatedFix - 3
Your CSS is hand written and neither Tailwind nor Bootstrap is loadedThe project uses neither frameworkFix
- 1
What does the error look like?
Pagination arrows fill the whole page width{{ $users->links() }} prints plain links with no styling
Cause 1 of 3
The app uses Bootstrap but the paginator still renders Tailwind markup
1Check
By default the views rendered for the pagination links are compatible with Tailwind. Nothing switches them to Bootstrap unless you ask.
grep -rn "useBootstrap" app/Providers/2Fix
Call useBootstrapFive (or useBootstrapFour for Bootstrap 4) in the boot method of AppServiceProvider.
use Illuminate\Pagination\Paginator;
public function boot(): void
{
Paginator::useBootstrapFive();
}3Verify
Clear compiled views and reload the page; the links now use Bootstrap's pagination classes.
php artisan view:clearConfirmed by laravel.com
Cause 2 of 3
Tailwind 4 never scans the pagination views, so its classes are not generated
1Check
Tailwind treats source files as plain text and skips files listed in .gitignore, which usually includes vendor. Class names that only appear in the pagination views are then never generated, so the stylesheet needs an explicit @source line for them.
grep -n "@source" resources/css/app.css2Fix
Add the @source line for Laravel's pagination views to your main CSS file, then rebuild the assets.
@import 'tailwindcss';
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';3Verify
Rebuild the front end and reload the page.
npm run buildConfirmed by tailwindcss.com
Cause 3 of 3
The project uses neither framework
1Check
The built-in views only look right with the framework they target. Without it you need markup that matches your own CSS.
ls resources/views/vendor/pagination 2>/dev/null2Fix
Publish the pagination views, edit the one you want as the default, and set it with defaultView in AppServiceProvider (or pass the view name to links()).
php artisan vendor:publish --tag=laravel-pagination
// AppServiceProvider::boot()
Paginator::defaultView('pagination.custom');
Paginator::defaultSimpleView('pagination.custom-simple');3Verify
Reload the page and confirm the links use your markup.
php artisan view:clearConfirmed by laravel.com
How do I stop it coming back?
- Decide on one CSS framework per project and set the paginator view in AppServiceProvider on day one.
- Keep the @source line for the pagination views in app.css when you upgrade Tailwind or rewrite the stylesheet.
- Review published pagination views in resources/views/vendor/pagination when you change CSS frameworks.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
Composer says the gd extension is missing on a Laravel project
composer install or composer update stops on a package that requires ext-gd
Composer refuses to install a package that requires ext-gd when the PHP binary running Composer has no GD extension.
4 causes, each with a fixBack end
composer require maatwebsite/excel fails to install
Composer says the package needs an older PHP than the one installed
Composer refuses maatwebsite/excel when the PHP version or a PHP extension does not match what the package and PhpSpreadsheet need.
3 causes, each with a fixBack end
composer install says the lock file is not compatible and asks for update
Your lock file does not contain a compatible set of packages. Please run composer update.
composer install checked the locked packages against this machine's PHP and extensions and found a conflict.
3 causes, each with a fixBack end
composer require laravel/horizon fails: ext-pcntl is missing
laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system
Horizon needs the pcntl extension, and Composer refuses to install it where PHP lacks that extension.
3 causes, each with a fixBack end
composer require laravel/passport stops with 'requirements could not be resolved'
... but these were not loaded, likely because it conflicts with another require.
Composer found no Passport release that fits your project at once.
4 causes, each with a fixBack end
Composer says the root composer.json requires a PHP version your PHP does not satisfy
Your requirements could not be resolved to an installable set of packages.
Composer compares the php constraint in your composer.json, or in a package, with the PHP that runs Composer.
3 causes, each with a fix