Installation
Run composer require ujnana/pinex in your Laravel project.
Ensure your project meets the requirements (PHP 8.1+, Laravel 11+, Livewire 3+, Tailwind CSS 4+).
Tailwind Integration
Update your resources/css/app.css with:
@import "tailwindcss";
@source "../../vendor/ujnana/pinex/src/Views";
Rebuild Tailwind assets (npx tailwindcss -i ./resources/css/app.css -o ./resources/css/dist.css --watch).
First Use Case
Use the Button component in a Livewire view:
<x-pinex.button type="primary" wire:click="submitForm">
Save Changes
</x-pinex.button>
Register the component in your Livewire class:
use Ujnana\Pinex\Components\Button;
Livewire Integration All Pinex components are designed for Livewire 3. Use them directly in Blade templates:
<x-pinex.input
wire:model="name"
label="Full Name"
placeholder="Enter your name"
:error="$errors->first('name')"
/>
Dynamic Props
Leverage Tailwind variants via props (e.g., variant="outline", size="lg"):
<x-pinex.button variant="outline" size="lg" wire:click="reset">
Reset
</x-pinex.button>
Nested Components
Combine components for complex UIs (e.g., Card + Table):
<x-pinex.card>
<x-slot name="header">
<h3 class="text-lg font-medium">User List</h3>
</x-slot>
<x-pinex.table :data="$users" />
</x-pinex.card>
Slot-Based Layouts Use named slots for custom content:
<x-pinex.modal>
<x-slot name="title">Confirm Action</x-slot>
<x-slot name="content">Are you sure?</x-slot>
<x-slot name="footer">
<x-pinex.button type="primary" wire:click="confirm">Yes</x-pinex.button>
</x-slot>
</x-pinex.modal>
<x-pinex.input> with Livewire model binding (wire:model) and validation.wire:click, wire:model.defer, and wire:ignore for reactive UIs.aria-modal, aria-label).Tailwind v4 Configuration
@source directive may break component styles.app.css includes @source pointing to Pinex views.Livewire 3 Compatibility
wire:model.lazy) may fail.wire:model without .lazy (or update to Livewire 3).Component Overrides
php artisan vendor:publish --tag=pinex-views
Then modify resources/views/vendor/pinex/.Modal Z-Index Conflicts
z-index in your CSS:
.pinex-modal-overlay { z-index: 50; }
{{ dd($this->props) }} in Livewire components to debug passed props.handleClick() or similar methods to trace interactions.Custom Variants
Extend components by adding new variants (e.g., variant="danger"):
<x-pinex.button variant="danger" wire:click="delete">
Delete
</x-pinex.button>
Update the component’s Tailwind classes in the source or published views.
New Components Fork the package or create a wrapper component:
// app/View/Components/PinexExtendedButton.php
class PinexExtendedButton extends Button {
public function render() {
$this->class += ' custom-class';
return parent::render();
}
}
Dark Mode
Ensure Pinex components support Tailwind’s dark: variants by adding:
@layer components {
.dark .pinex-button {
@apply bg-gray-800 text-white;
}
}
Localization Override labels/placeholders via Blade slots or Livewire props:
<x-pinex.input label="{{ __('Custom Label') }}" />
How can I help you explore Laravel packages today?