Update v4.2 - New components, 10+ framework guides, and quality improvements. Visit Changelog

Install Preline UI with Laravel using Tailwind CSS

Install Preline UI with Tailwind CSS in Laravel projects, including JavaScript plugin setup, Vite configuration, Blade templates, and optional dependencies.

Laravel quick setup

If Tailwind CSS is not set up yet, start with the official Laravel + Tailwind CSS guide first.

  1. Install Preline UI

    Install preline with your preferred package manager.

    Terminal
                              
                                npm install preline
                              
                            

    Preline UI uses the Tailwind CSS Forms plugin across form components. Install it if you have not already: npm install -D @tailwindcss/forms

  2. Import Preline CSS and source files

    Import variants.css into app.css after the tailwindcss import, then add the @source entry for Preline UI JavaScript.

    app.css
                              
                                @import "tailwindcss";
                    
                                /* Preline UI */
                                @import "../../node_modules/preline/variants.css";
                                @source "../../node_modules/preline/dist/*.js";
                    
                                /* Plugins */
                                /* @plugin "@tailwindcss/forms"; */
    
                                /* Preline Themes */
                                @import "./themes/theme.css";
                              
                            

    See the Theme docs to learn more about Preline Themes.

  3. Add Preline UI to the app entry

    Import Preline UI in your JavaScript entry file, for example app.js.

    app.js
                              
                                // index.js
                                import 'preline'
                              
                            
  4. Load assets with Vite

    With your Vite entry points configured, reference them with @vite() in the <head> of your root Blade layout.

                              
                            

Optional Preline UI styles

Preline UI ships with a small set of opinionated base styles. If you want them in your project, add them to your CSS file. These defaults used to come bundled with Tailwind CSS v3, so they are still available as an optional layer in Preline UI.

CSS
                        
                          /* Adds pointer cursor to buttons */
                          @layer base {
                            button:not(:disabled),
                            [role="button"]:not(:disabled) {
                              cursor: pointer;
                            }
                          }

                          /* Defaults hover styles on all devices */
                          @custom-variant hover (&:hover);
                        
                      

© 2026 Preline Labs.