leenuxus/jarenui
JarenUI is a Laravel PHP package for building UI components and layouts quickly. It aims to simplify creating reusable frontend elements in your app, keeping views organized and consistent with a component-based approach.
Installation
composer require leenuxus/jarenui
Publish the config (if available) with:
php artisan vendor:publish --provider="JarenUI\JarenUIServiceProvider" --tag="config"
First Use Case
Include the package in your resources/views/app.blade.php (or layout file):
@livewireStyles
@livewireScripts
@jarenuiStyles
@jarenuiScripts
Use a basic component in a Blade view:
<x-jarenui::card title="Hello World">
<p>This is a reusable card component.</p>
</x-jarenui::card>
Where to Look First
resources/views/vendor/jarenui directory for available components (e.g., card.blade.php, button.blade.php).app/Http/Livewire directory for any bundled Livewire components (if included).config/jarenui.php for customization options (e.g., default colors, icons).Basic Components
<!-- Card -->
<x-jarenui::card>
<x-slot name="title">Title</x-slot>
<p>Content here.</p>
</x-jarenui::card>
<!-- Button -->
<x-jarenui::button type="primary">Click Me</x-jarenui::button>
Slot-Based Customization Most components support slots for flexibility:
<x-jarenui::alert type="success">
<x-slot name="icon">✅</x-slot>
<p>Success message!</p>
</x-jarenui::alert>
Extend Existing Components
If the package includes Livewire components (e.g., LivewireCard), extend them:
namespace App\Http\Livewire;
use JarenUI\Livewire\LivewireCard;
class CustomCard extends LivewireCard
{
public $customProperty = "Extra data";
public function render()
{
return view('livewire.custom-card', [
'customProperty' => $this->customProperty,
]);
}
}
Create New Livewire Components Use the package’s design system for consistency:
use Livewire\Component;
use JarenUI\Support\Traits\HasJarenUIStyles;
class MyComponent extends Component
{
use HasJarenUIStyles;
public function render()
{
return view('livewire.my-component')->withJarenUIStyles();
}
}
Customize via Config
Override defaults in config/jarenui.php:
'colors' => [
'primary' => '#3b82f6', // Tailwind-like syntax
],
Tailwind CSS Compatibility
The package likely assumes Tailwind. Extend your tailwind.config.js:
module.exports = {
plugins: [
require('jarenui/tailwind')(), // Hypothetical plugin
],
};
php artisan jarenui:list (if the package includes a CLI command) to see available components.resources/views/vendor/jarenui to customize without forking.@livewire('jarenui.card', 'opened')).No Official Documentation
vendor/leenuxus/jarenui) for usage.src/Traits/HasJarenUIStyles.php for shared functionality.Livewire Version Mismatch
composer.json:
"require": {
"livewire/livewire": "^2.0"
}
Tailwind Dependencies
bg-primary). Ensure Tailwind is installed and configured.Namespace Collisions
x-jarenui:: prefix. If you create similar components, use unique namespaces (e.g., x-myapp::).Component Not Found?
Verify the view exists in vendor/leenuxus/jarenui/resources/views or your local override.
Clear Blade cache:
php artisan view:clear
Livewire Component Errors
Check for missing use Livewire\Component; or incorrect slot names in Blade views.
CSS/JS Loading Issues
Ensure @jarenuiStyles and @jarenuiScripts are included after @livewireStyles in your layout.
Create Custom Components Extend existing components by copying their Blade/Livewire files to your project and modifying:
cp vendor/leenuxus/jarenui/resources/views/components/card.blade.php resources/views/components/
Add New Features Fork the package and submit PRs (if open to contributions). Example:
Modal component by copying from another package or building from scratch using the package’s design system.Configuration Overrides Publish and extend the config:
php artisan vendor:publish --tag="config" --force
Then add custom options to config/jarenui.php.
Use @once for Shared Styles
Avoid duplicate @jarenuiStyles directives in nested views:
@once
@jarenuiStyles
@endonce
Leverage Livewire for Dynamic Content Combine JarenUI’s static components with Livewire for interactive elements:
<x-jarenui::card>
<livewire:my-dynamic-content />
</x-jarenui::card>
Test Locally First Since the package is personal, test changes in a local Laravel project before deploying to production.
How can I help you explore Laravel packages today?