Skip to content

zhouyl/flowblade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Flowblade

Laravel 11+ PHP 8.3+ Tailwind CSS MIT License

A modern Laravel Blade component library based on Flowbite + Tailwind CSS, with an intuitive Style Props API for elegant component styling.

🎯 Design Philosophy

Flowblade embraces a server-side component-driven architecture using Laravel Livewire and Alpine.js, offering significant development efficiency improvements over traditional API + Vue/React approaches:

Why Flowblade?

  • Faster Development: Build interactive UIs without context-switching between backend and frontend frameworks. Write PHP and Blade templates, leverage Livewire for reactivity. 30-50% faster development compared to traditional API + Vue/React approaches.
  • Reduced Complexity: No need to manage separate API endpoints, state management libraries, or complex build pipelines. Everything integrates seamlessly with Laravel.
  • Better DX: Full-stack developers can work on features end-to-end without learning multiple frameworks. Blade components are familiar to Laravel developers.
  • Smaller Bundle Size: Alpine.js (15KB) vs Vue/React (40KB+), resulting in faster page loads and better performance.
  • Real-time Reactivity: Livewire provides real-time component updates without writing JavaScript, while Alpine.js handles lightweight interactivity.
  • SEO-Friendly: Server-rendered HTML by default, perfect for content-heavy applications.

Development Advantages

  • Reduced Tech Stack: Single language (PHP) instead of managing PHP + JavaScript/TypeScript. Eliminates context-switching and reduces cognitive load.
  • Lower Learning Curve: Developers only need to know Laravel and Blade, not Vue/React/Angular. Onboarding time reduced by 40-60% for new team members.
  • Simplified Deployment: Deploy as a single Laravel application. No separate frontend build process, no Node.js in production, no API versioning concerns.
  • Faster Iteration: Changes to UI logic don't require rebuilding frontend assets. Hot reload works seamlessly with Laravel's development server.

Perfect For

  • Admin Dashboards: Rapid development of internal tools with real-time updates and complex forms
  • Small to Medium Web Applications: Content management systems, SaaS platforms, business applications
  • Laravel Applications: Seamless integration with Laravel's ecosystem
  • Full-Stack Teams: Developers comfortable with PHP and Blade templates
  • Rapid Prototyping: Build features quickly without framework overhead
  • Content-Heavy Sites: Server-side rendering with progressive enhancement
  • Real-time Applications: Livewire's reactive components for live updates

✨ Features

  • 🎨 138+ Components - Comprehensive UI component library
  • πŸš€ Style Props System - Intuitive props like color="primary" and size="lg" for flexible styling
  • 🎯 Tailwind CSS - Built on Tailwind's utility-first approach
  • ⚑ Alpine.js Ready - Built-in Alpine.js integration
  • πŸ”Œ Livewire Compatible - Full support for wire:model, wire:click, etc.
  • 🎭 Iconify Support - Access 100,000+ icons with <x-icon name="heroicons:check" />
  • πŸŽ›οΈ Highly Configurable - Customize colors, sizes, and component prefixes
  • πŸ“¦ Zero Config - Works immediately after composer require

πŸ“‹ Requirements

Before installing Flowblade, ensure your project meets these requirements:

System Requirements

  • Laravel: 11.0 or higher
  • PHP: 8.3 or higher
  • Tailwind CSS: 4.0 or higher
  • Node.js: 16.0 or higher (for asset compilation)

Dependencies

Flowblade requires the following packages (automatically installed):

  • flowbite: ^3.0 - Design system and JavaScript components
  • tailwindcss: ^4.0 - Utility-first CSS framework
  • @tailwindcss/forms: ^0.5 - Form styling plugin

Optional Dependencies

For enhanced functionality, you may want to install:

  • Alpine.js: ^3.0 - For lightweight interactivity (included in Flowbite)
  • Livewire: ^3.0 - For reactive components (composer require livewire/livewire)
  • Iconify: For icon support (included via CDN)

πŸ“¦ Installation

Step 1: Install via Composer

composer require mellivora/flowblade

Step 2: Publish Configuration (Optional)

To customize component prefixes, colors, and sizes:

php artisan vendor:publish --tag=flowblade-config

This creates config/flowblade.php where you can configure:

  • Component prefix (default: x-)
  • Default colors and sizes
  • Color and size mappings

See the Quick Start Guide for detailed configuration options.

Step 3: Configure Tailwind CSS

Add Flowblade views to your tailwind.config.js:

export default {
  content: [
    "./resources/**/*.blade.php",
    "./vendor/mellivora/flowblade/resources/views/**/*.blade.php",
  ],
}

Step 4: Compile Assets

npm run dev

πŸ“š Documentation

For detailed setup instructions and configuration options, see:

🎨 Style Props System

Flowblade includes a powerful Style Props system that allows you to style components using intuitive props instead of writing Tailwind classes directly:

Spacing Props

{{-- Padding --}}
<x-box p="6">All sides</x-box>
<x-box px="4" py="8">Horizontal and vertical</x-box>
<x-box pt="2" pr="4" pb="6" pl="8">Individual sides</x-box>

{{-- Margin --}}
<x-box m="4">All sides</x-box>
<x-box mx="auto">Horizontal centering</x-box>
<x-box my="6">Vertical margin</x-box>

Sizing Props

{{-- Width and Height --}}
<x-box w="full" h="64">Full width, 16rem height</x-box>
<x-box w="1/2" h="auto">Half width, auto height</x-box>
<x-box minW="xs" maxW="2xl">Min/max width constraints</x-box>
<x-box minH="screen" maxH="96">Min/max height constraints</x-box>

Color Props

{{-- Background and Text Colors --}}
<x-box bg="primary" color="white">Primary background</x-box>
<x-box bg="blue.500" color="gray.700">Using color scales</x-box>
<x-box borderColor="red.300">Border color</x-box>

Layout Props

{{-- Display and Position --}}
<x-box display="flex" position="relative">Flex layout</x-box>
<x-box display="grid" zIndex="10">Grid layout</x-box>
<x-box overflow="hidden" overflowY="auto">Overflow control</x-box>

Flexbox Props

{{-- Flex Container --}}
<x-box flex="1" flexDirection="column" alignItems="center" justifyContent="between" gap="4">
    Flex layout with gap
</x-box>

Typography Props

{{-- Text Styling --}}
<x-box fontSize="lg" fontWeight="bold" textAlign="center" lineHeight="tight">
    Styled text
</x-box>

Border and Radius Props

{{-- Borders and Rounded Corners --}}
<x-box border="2" borderColor="gray.300" rounded="lg">Bordered box</x-box>
<x-box rounded="full">Fully rounded</x-box>
<x-box borderRadius="xl">Large radius</x-box>

Shadow and Effects Props

{{-- Shadows and Effects --}}
<x-box shadow="md" opacity="75">Box with shadow</x-box>
<x-box shadow="lg" cursor="pointer" transition="all">Interactive box</x-box>

Available Color Scales

primary secondary success warning danger info gray blue red green yellow purple pink indigo cyan teal

Each color supports scales: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900

Available Sizes

2xs xs sm md lg xl 2xl 3xl 4xl

Button Variants

solid outline ghost link subtle

πŸ’‘ Advanced Examples

Form with Validation

<x-box p="8" shadow="lg" rounded="xl" maxW="md" mx="auto">
    <x-vstack spacing="md">
        <x-heading size="lg">Contact Form</x-heading>

        <div>
            <label class="block text-sm font-medium mb-2">Name</label>
            <x-input placeholder="Your name" />
        </div>

        <div>
            <label class="block text-sm font-medium mb-2">Email</label>
            <x-input type="email" placeholder="[email protected]" />
        </div>

        <div>
            <label class="block text-sm font-medium mb-2">Message</label>
            <x-textarea placeholder="Your message" rows="4" />
        </div>

        <x-hstack spacing="md" justify="end">
            <x-button variant="outline">Cancel</x-button>
            <x-button color="primary">Send</x-button>
        </x-hstack>
    </x-vstack>
</x-box>

Dashboard Card Grid

<x-grid columns="4" gap="6">
    @foreach($stats as $stat)
        <x-card shadow="md" rounded="lg">
            <x-card-body>
                <x-vstack spacing="md">
                    <x-hstack justify="between" align="start">
                        <x-vstack spacing="xs">
                            <x-text color="gray.600" fontSize="sm">{{ $stat['label'] }}</x-text>
                            <x-heading size="2xl">{{ $stat['value'] }}</x-heading>
                        </x-vstack>
                        <x-icon :name="$stat['icon']" size="32px" color="primary" />
                    </x-hstack>
                    <x-text color="green.600" fontSize="sm">{{ $stat['change'] }}</x-text>
                </x-vstack>
            </x-card-body>
        </x-card>
    @endforeach
</x-grid>

Navigation with Dropdown

<x-navbar bg="white" shadow="md">
    <x-navbar-brand href="/">
        <x-heading size="lg">MyApp</x-heading>
    </x-navbar-brand>

    <x-navbar-collapse>
        <x-navbar-link href="/features">Features</x-navbar-link>
        <x-navbar-link href="/pricing">Pricing</x-navbar-link>
        <x-navbar-link href="/docs">Documentation</x-navbar-link>
    </x-navbar-collapse>

    <x-hstack spacing="md">
        <x-button variant="ghost">Sign In</x-button>
        <x-button color="primary">Get Started</x-button>
    </x-hstack>
</x-navbar>

πŸ“ Available Components

Flowblade includes 138+ production-ready components organized by category. All components feature:

  • βœ… Style Props Support - Intuitive styling system with semantic props
  • βœ… Complete Documentation - Detailed usage examples and API reference
  • βœ… Accessibility Features - WCAG 2.1 compliant with keyboard navigation
  • βœ… Responsive Design - Mobile-first approach with Tailwind CSS
  • βœ… Flowbite Integration - Built on Flowbite design system

For a complete list of all components with detailed documentation, see Components Documentation.

πŸš€ Getting Help

Documentation

Resources

🀝 Contributing

Contributions are welcome! Here's how you can help:

  1. Report Issues - Found a bug? Open an issue
  2. Suggest Features - Have an idea? Create a feature request
  3. Submit Pull Requests - Want to contribute code? Fork and submit a PR
  4. Improve Documentation - Help us improve docs and examples

Development Setup

# Clone the repository
git clone https://github.com/zhouyl/flowblade.git
cd flowblade

# Install dependencies
composer install
npm install

# Run tests
composer test

# Build documentation
npm run build

πŸ“„ License

MIT License. See LICENSE for details.

πŸ”— Links

πŸ’ Support

If you find Flowblade helpful, please consider:

  • ⭐ Starring the repository
  • πŸ› Reporting bugs and suggesting features
  • πŸ“ Contributing to documentation
  • 🀝 Sharing with the community

About

A Laravel Blade component library based on Flowbite + Tailwind CSS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published