bladewindUI

Getting Started

BladewindUI is a collection of super simple but elegant Laravel blade-based UI components using TailwindCSS and vanilla Javascript. When I decided to move away from JQuery, that indirectly meant I had to find an alternative to the lovely Semantic UI components I had gotten so used to. Well, that was how these components were born.

Prerequisites

Bladewind components are purely Laravel blade components with some tailwindcss sweetness. This means you absolutely need to be using Bladewind in a Laravel project. The package has the following dependencies:

PHP >= 7.3


Install

At the root of your Laravel project, type the following composer command in your terminal to pull in the package.

composer require mkocansey/bladewind

Next you need to publish the package assets by running this command, still at the root of your Laravel project. You always need to publish assets when you update to a new version of BladewindUI. See Update Notes at the bottom of this page.

php artisan vendor:publish --provider="Mkocansey\Bladewind\BladewindServiceProvider" --tag=laravel-assets --force

Now include the BladewindUI css file and initialize a few javascript variables in the <head> of your pages. This should ideally be done in the layouts file your app's pages extend from.

        
            // this is required for the animation of notifications and slide out panels
            // you can ignore this if you already have animate.css (https://animate.style/) in your project
            
            <link href="{{ asset('bladewind/css/animate.min.css') }}" rel="stylesheet" />

            <link href="{{ asset('bladewind/css/bladewind-ui.min.css') }}" rel="stylesheet" />

            <script src="{{ asset('bladewind/js/helpers.js') }}"></script>


            
                // The Datepicker and Timepicker components require AlpineJs 3.x to work. 
                // Include this in your <head>. You can ignore this final step if 
                // you are already using AlpineJs in your project

                <script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
            
        


You are now ready to start using any of the BladewindUI components in your application

            
                <x-bladewind.button>Save User</x-bladewind.button>
            
        


BladewindUI components have been designed to be non destructive, meaning, they coexist with any other components you may already have in your project. The following happened when you run the vendor:publish command earlier on:

1. The blade components now exist in resources > views > components > bladewind

2. The supporting CSS and JS files have been placed in public > bladewind

3. The language files for the Datepicker component have been placed in lang > bladewind. The default languages shipped with the Datepicker are English, French and Italian. You can add more languages.


If you intend to use bladewindUI in a Laravel 8.x project, please do well to read this.



Updating Bladewind

composer update

When you update the Bladewind package via composer update the assets are republished since it is possible changes were made to the library's CSS or JS files. If you see output similar to what is below, it means the assets were successfully published.

        
            Copied Directory [/vendor/mkocansey/bladewind/src/resources/views/components] To [/resources/views/components/bladewind]
            Copied Directory [/vendor/mkocansey/bladewind/src/resources/lang] To [/resources/lang]
            Copied Directory [/vendor/mkocansey/bladewind/src/resources/assets/compiled] To [/public/bladewind]
        
    

If you do not see output similar to what is above, you will need to manually republish the assets by running the command below.

php artisan vendor:publish --provider="Mkocansey\Bladewind\BladewindServiceProvider" --tag=laravel-assets --force