1. Go to this page and download the library: Download leenuxus/jarenui library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
leenuxus / jarenui example snippets
// From Livewire:
$this->dispatch('jaren-toast', type: 'success', title: 'Saved!', message: 'All good.', duration: 4000);
// Using HasToast trait:
use jarenui\Concerns\HasToast;
$this->toast()->success('Saved!', 'Changes applied.');
$this->toast()->persistent()->action('Undo', 'undo-delete')->danger('Deleted', 'Row removed.');
public array $dates = [];
use JarenUI\DateRange;
public ?DateRange $range;
public function mount(): void
{
$this->range = new DateRange(now(), now()->addDays(7));
}
use JarenUI\DateRange;
$range = new DateRange(now()->subDays(6), now());
$range->start(); // Carbon — start date
$range->end(); // Carbon — end date
$range->length(); // int — number of days inclusive
$range->contains($date); // bool
$range->toArray(); // Carbon[] — one per day
(string) $range; // '2026-05-22/2026-05-29'
// With Eloquent:
Order::whereBetween('created_at', $range)->get();
use Livewire\Attributes\Session;
#[Session]
public ?DateRange $range;
class MeetingsCalendar extends \JarenUI\Livewire\EventCalendar
{
public array $availableViews = ['month', 'week']; // hide day view
public bool $creatable = true;
public int $startDay = 1; // Monday
public string $view = 'week'; // default to week view
public int $dayStartHour = 8;
public int $dayEndHour = 18;
public function fetchEvents(Carbon $from, Carbon $to): array { ... }
}
#[On('jaren-event-selected')]
public function onEventSelected(array $event): void
{
$this->selectedId = $event['id'];
}
#[On('jaren-event-created')]
public function onEventCreated(string $date): void
{
$this->dispatch('open-modal', name: 'create-event', date: $date);
}
class OnboardingWizard extends \JarenUI\Livewire\Wizard
{
// Step definitions — id + label (+ optional icon)
public array $steps = [
['id' => 'account', 'label' => 'Account'],
['id' => 'plan', 'label' => 'Plan'],
['id' => 'review', 'label' => 'Review'],
];
// One property bag per step
public array $account = ['name' => '', 'email' => ''];
public array $plan = ['plan_id' => null];
// Per-step validation rules
protected array $stepRules = [
'account' => [
'account.name' => 'n the last step
public function submit(): void
{
User::create($this->account);
Subscription::create(['user_id' => auth()->id(), ...$this->plan]);
$this->complete(); // marks wizard as done, shows success panel
}
// Data attached to the jaren-wizard-completed event
protected function completedData(): array
{
return ['account' => $this->account, 'plan' => $this->plan];
}
}
// Called when about to leave a step — useful for cleanup
protected function onStepLeaving(string $stepId): void
{
if ($stepId === 'payment') {
// release any held resources
}
}
// Called just after entering a step — useful for loading data
protected function onStepEntering(string $stepId): void
{
if ($stepId === 'review') {
$this->summary = $this->buildSummary();
}
}
// Called when cancel() is triggered
protected function onCancel(): void
{
session()->forget('wizard_progress');
}
#[On('jaren-wizard-completed')]
public function onWizardDone(array $data): void
{
$this->redirect(route('dashboard'));
}