Installation
composer require datalogix/tallkit
Publish the package assets (if needed):
php artisan vendor:publish --provider="Datalogix\Tallkit\TallkitServiceProvider" --tag="public"
First Use Case: Basic Button Include the package in your Blade view:
@use('Datalogix\Tallkit\Components\Button')
Render a button:
<x-button type="primary">Click Me</x-button>
Where to Look First
vendor/datalogix/tallkit/src/Components/ for available components (e.g., Button.php, Alert.php).@use or <x-component>.Component Integration
autocomplete or command with dynamic data:
<x-autocomplete :items="$dynamicItems" placeholder="Search..." />
button with variants:
<x-button type="danger" outline>Delete</x-button>
Form Fields
field wrapper for consistent styling:
<x-field label="Username">
<x-input name="username" />
</x-field>
toggle, slider, or upload:
<x-toggle name="active" label="Enable Feature" />
Layout Components
header or build a nav with active states:
<x-header title="Dashboard" subtitle="Welcome back" />
paginator with per-page select:
<x-paginator :items="$posts" per-page-options="[5, 10, 20]" />
Advanced Features
<x-editor :content="$post->content" />
date-picker or color-picker:
<x-date-picker name="event_date" />
Event Handling
autocomplete:selected). Listen via Alpine.js:
<x-autocomplete @selected="handleSelection" />
<script>
document.addEventListener('autocomplete:selected', (e) => {
console.log(e.detail);
});
</script>
Dynamic Loading
autocomplete or command, ensure data is fetched via AJAX to avoid initial load delays:
<x-autocomplete :items="[]">
@push('scripts')
<script>
document.querySelector('x-autocomplete').addEventListener('search', (e) => {
fetch(`/api/search?q=${e.detail.query}`)
.then(res => res.json())
.then(items => {
document.querySelector('x-autocomplete').items = items;
});
});
</script>
@endpush
</x-autocomplete>
Styling Conflicts
tailwind.config.js or scoped classes:
/* Example: Override button padding */
.tallkit-button {
@apply py-3 px-4;
}
Missing Dependencies
toggle, slider) require Alpine.js. Include it in your layout:
@vite(['resources/js/app.js', 'resources/js/alpine.js'])
Component Registration
AppServiceProvider:
Tallkit::registerComponents();
Inspect Blade Output
@dd() to debug component props:
@dd(\Datalogix\Tallkit\Components\Button::class)
Check for Errors
APP_DEBUG=true) and check logs for missing views or props.Component Isolation
Custom Components
namespace App\Components;
use Datalogix\Tallkit\Components\Button;
class CustomButton extends Button {
public function customMethod() { ... }
}
AppServiceProvider:
Tallkit::extend('custom-button', CustomButton::class);
Adding New Variants
resources/views/vendor/tallkit/:
<!-- resources/views/vendor/tallkit/button.blade.php -->
@props(['type' => 'primary'])
<button class="bg-{{ $type }}-500 ...">...</button>
JavaScript Enhancements
<x-upload @uploaded="console.log('Uploaded!')" />
Configuration
php artisan vendor:publish --tag="tallkit-config"
config/tallkit.php.How can I help you explore Laravel packages today?