Skip to content

Components

Kompass ships a full set of Blade components for building admin interfaces. Every component accepts additional HTML attributes and is styled with Tailwind CSS — so you can drop them into any Livewire view and extend them with your own classes.

Form Components

Input

blade
<x-kompass::form.input
    wire:model="fieldName"
    id="field-id"
    name="field-name"
    label="Field Label"
    type="text"
    placeholder="Enter value"
    disabled
/>
PropTypeDefaultDescription
wire:modelstringLivewire binding
labelstringLabel text
typestringtextInput type
disabledboolfalseDisable input

Textarea

blade
<x-kompass::form.textarea
    wire:model="description"
    id="description"
    label="Description"
    rows="4"
/>

Select

blade
<x-kompass::form.select
    wire:model="selectedOption"
    id="select-id"
    :options="$options"
    placeholder="Select option"
    :searchable="true"
    label="Select Option"
/>
PropTypeDefaultDescription
optionsarray[value => label] pairs
searchableboolfalseEnable search

Input Error

Use input-error to display Livewire validation messages beneath a field:

blade
<x-kompass::input-error for="fieldName" class="mt-2" />

Layout Components

Kompass uses Alpine.js event dispatching to open modals. Define the modal by name, then trigger it from any element:

blade
<x-kompass::modal data="modalName" />

<button @click="$dispatch('open-modal', 'modalName')">Open</button>

Offcanvas

blade
<x-kompass::offcanvas :w="'w-2/6'">
    <x-slot name="body"><!-- Content --></x-slot>
</x-kompass::offcanvas>

Action Message

Display a transient status message — for example after saving a record. Dispatch the event name from your Livewire component to show the message:

blade
<x-kompass::action-message class="fixed bottom-8 right-8" on="status">
    <div><h4>Saved.</h4></div>
</x-kompass::action-message>

{{-- Trigger --}}
$this->dispatch('status');

blade
<x-kompass::nav-item href="/admin/pages" :active="$active" icon="tabler-layout">
    Pages
</x-kompass::nav-item>

Group related nav items under a collapsible label:

blade
<x-kompass::nav-itemgroup label="Settings" icon="tabler-settings">
    <x-slot name="items">
        <x-kompass::nav-item href="/admin/settings/general">General</x-kompass::nav-item>
    </x-slot>
</x-kompass::nav-itemgroup>

Block Components

These components render the block editor UI. Use them inside your admin views to display and manage content blocks for a page:

blade
<x-kompass::blocks :page="$page" :blocks="$blocks" />
<x-kompass::blocksgroup :item="$block" :loop="$loop" />
<x-kompass::blocksgroupsub :item="$childBlock" />

Media Components

The upload-image component handles image uploads with Livewire. Pass the current image path via :current to display an existing preview:

blade
<x-kompass::upload-image wire:model="photo" :current="$user->profile_photo_path" />

blade
<x-kompass::menu-profile :user="$user" />
<x-kompass::menugroup :menus="$menus" />
<x-kompass::menugroupsub :items="$menuItems" />

UI Components

Kompass provides primary and secondary button variants, a heading component, and a section title block:

blade
<x-kompass::button wire:click="save" type="submit" class="btn-primary">Save</x-kompass::button>
<x-kompass::secondary-button wire:click="cancel">Cancel</x-kompass::secondary-button>
<x-kompass::heading :title="$page->title" :size="'text-2xl'" />
blade
<x-kompass::section-title>
    <x-slot name="title">Section Title</x-slot>
    <x-slot name="description">Section description</x-slot>
</x-kompass::section-title>

Alert Components

Use banner for inline messages and config-notification for structured notices with a title and message body:

blade
<x-kompass::banner :type="'success'">Message</x-kompass::banner>

<x-kompass::config-notification
    :type="'warning'"
    :title="'Update Required'"
    :message="'Please update your settings'"
/>

Icons

Kompass uses Tabler Icons via the secondnetwork/blade-tabler-icons package — both as direct <x-tabler-*> components and the dynamic <x-kompass::icon> helper.

See the dedicated Icons page for full usage.

Released under the MIT License.