Skip to content
TallCraftUI

Configuration

TallCraftUI works without any configuration. Publish the config file when you want a component prefix or different defaults, such as a larger button size or toasts in another corner.

Publish the configuration file

Terminal
php artisan vendor:publish --tag=tallcraftui-config

This creates config/tallcraftui.php. Keys you leave out keep their default values, and keys added in later releases are filled in automatically, so an older published file keeps working.

Component prefix

By default components are available as <x-button>, <x-input> and so on. Set a prefix to avoid clashing with components your app already has:

config/tallcraftui.php
'prefix' => env('TALLCRAFTUI_PREFIX', ''),
 
// 'prefix' => '' -> <x-input />
// 'prefix' => 'tc-' -> <x-tc-input />

Or set it in .env without publishing the config:

.env
TALLCRAFTUI_PREFIX="tc-"

Then clear the view cache:

Terminal
php artisan view:clear

Icons

Components use Heroicons through blade-ui-kit/blade-heroicons. Choose the outline or solid style for all components:

config/tallcraftui.php
'icons' => [
'type' => 'heroicons',
'style' => 'outline', // outline or solid
],

Component defaults

Each component reads its default size, radius, shadow, position or behavior from its own key. A prop or attribute on a single component always wins over the default. These are the defaults this site runs with:

Key Settings
avatar
border-radius: rounded-full
alert
border-radius: rounded-sm
badge
border-radius: rounded-sm
breadcrumb
border-radius: rounded-sm
button
size: md border-radius: rounded-sm
card
shadow: shadow-xs border-radius: rounded-lg
dropdown
width: w-48 shadow: shadow-sm position: bottom-end animation: fade border-radius: rounded-sm
drawer
width: lg blur: false trap-focus: true
modal
size: lg blur: false trap-focus: true position: top border-radius: rounded-lg
progress
size: md
stat
border-radius: rounded-lg
table
shadow: shadow-none border-radius: rounded-lg
tooltip
position: top gradient: false noArrow: false noTransition: false
toast
position: bottom-right showCloseIcon: false showProgress: false timeout: 3000
menu
width: w-56 shadow: shadow-sm border-radius: rounded-md
checkbox
size: md border-radius: rounded-sm
input
size: md border-radius: rounded-sm
native-select
size: md border-radius: rounded-sm
select
size: md
radio
size: md
rating
size: md
textarea
border-radius: rounded-sm
toggle
border-radius: rounded-sm

Values come from enums in Developermithu\Tallcraftui\Enums, such as Size::LG->value or BorderRadius::RoundedLg->value, but plain strings like 'lg' work too.

Markdown uploads

<x-markdown> uploads images through an endpoint that TallCraftUI registers. The upload section controls who can use it and what it accepts:

config/tallcraftui.php
'upload' => [
'enabled' => env('TALLCRAFTUI_UPLOAD_ENABLED', true),
'middleware' => ['web', 'auth'],
'disks' => ['public'],
'mimes' => ['jpg', 'jpeg', 'png', 'gif', 'webp', 'avif'],
'max_size' => 2048, // in kilobytes
],

Set TALLCRAFTUI_UPLOAD_ENABLED=false to remove the upload route entirely. SVG and HTML files are always rejected.

Full configuration file

The complete file as published by TallCraftUI 3.0.0-beta.1:

config/tallcraftui.php
<?php
 
use Developermithu\Tallcraftui\Enums\BorderRadius;
use Developermithu\Tallcraftui\Enums\DropdownAnimation;
use Developermithu\Tallcraftui\Enums\DropdownPosition;
use Developermithu\Tallcraftui\Enums\Position;
use Developermithu\Tallcraftui\Enums\Shadow;
use Developermithu\Tallcraftui\Enums\Size;
use Developermithu\Tallcraftui\Enums\ToastPosition;
use Developermithu\Tallcraftui\Enums\Width;
 
return [
 
/**
* --------------------------------------------------------------------------
* Default Component Prefix
* --------------------------------------------------------------------------
*
* The prefix applied to all components. After changing this value, be sure
* to clear the view cache using `php artisan view:clear`.
*
* Examples:
*
* 'prefix' => '' // <x-input />
* 'prefix' => 'tc-' // <x-tc-input />
*/
'prefix' => env('TALLCRAFTUI_PREFIX', ''),
 
/**
* --------------------------------------------------------------------------
* Route Prefix
* --------------------------------------------------------------------------
*/
'route_prefix' => env('TALLCRAFTUI_ROUTE_PREFIX', 'tallcraftui'),
 
/**
* --------------------------------------------------------------------------
* Markdown Image Upload
* --------------------------------------------------------------------------
*
* Endpoint used by <x-markdown /> to upload images. Only the listed disks
* are accepted; the folder comes from the component's `folder` prop.
*/
'upload' => [
'enabled' => env('TALLCRAFTUI_UPLOAD_ENABLED', true),
'middleware' => ['web', 'auth'],
'disks' => ['public'],
'mimes' => ['jpg', 'jpeg', 'png', 'gif', 'webp', 'avif'],
'max_size' => 2048, // in kilobytes
],
 
/**
* --------------------------------------------------------------------------
* Icon Configuration
* --------------------------------------------------------------------------
*
* The default icon settings for the components. You can specify the type
* and style of icons that should be used.
*
* type => Allowed: heroicons
* style => Allowed: outline, solid
*/
'icons' => [
'type' => 'heroicons',
'style' => 'outline',
],
 
/**
* --------------------------------------------------------------------------
* UI Components
* --------------------------------------------------------------------------
*
* Configure the appearance and behavior of ui components.
*/
'avatar' => [
'border-radius' => BorderRadius::RoundedFull->value,
],
 
'alert' => [
'border-radius' => BorderRadius::RoundedSm->value,
],
 
'badge' => [
'border-radius' => BorderRadius::RoundedSm->value,
],
 
'breadcrumb' => [
'border-radius' => BorderRadius::RoundedSm->value,
],
 
'button' => [
'size' => Size::MD->value,
'border-radius' => BorderRadius::RoundedSm->value,
],
 
'card' => [
'shadow' => Shadow::ShadowXs->value,
'border-radius' => BorderRadius::RoundedLg->value,
],
 
'dropdown' => [
'width' => Width::W48->value,
'shadow' => Shadow::ShadowSm->value,
'position' => DropdownPosition::BOTTOM_END->value,
'animation' => DropdownAnimation::FADE->value,
'border-radius' => BorderRadius::RoundedSm->value,
],
 
'drawer' => [
'width' => 'lg', // Allowed: sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl, 7xl, full
'blur' => false,
'trap-focus' => true,
],
 
'modal' => [
'size' => Size::LG->value,
'blur' => false, // Allowed: true, false
'trap-focus' => true, // Allowed: true, false
'position' => Position::TOP->value,
'border-radius' => BorderRadius::RoundedLg->value,
],
 
'progress' => [
'size' => Size::MD->value,
],
 
'stat' => [
'border-radius' => BorderRadius::RoundedLg->value,
],
 
'table' => [
'shadow' => Shadow::ShadowNone->value,
'border-radius' => BorderRadius::RoundedLg->value,
],
 
'tooltip' => [
'position' => Position::TOP->value,
'gradient' => false,
'noArrow' => false,
'noTransition' => false,
],
 
'toast' => [
'position' => ToastPosition::BOTTOM_RIGHT->value,
'showCloseIcon' => false,
'showProgress' => false,
'timeout' => 3000,
],
 
'menu' => [
'width' => Width::W56->value,
'shadow' => Shadow::ShadowSm->value,
'border-radius' => BorderRadius::RoundedMd->value,
],
 
/**
* --------------------------------------------------------------------------
* Form Components
* --------------------------------------------------------------------------
*
* Configure the appearance and behavior of form components.
*/
'checkbox' => [
'size' => Size::MD->value,
'border-radius' => BorderRadius::RoundedSm->value,
],
 
'input' => [
'size' => Size::MD->value,
'border-radius' => BorderRadius::RoundedSm->value,
],
 
'native-select' => [
'size' => Size::MD->value,
'border-radius' => BorderRadius::RoundedSm->value,
],
 
'select' => [
'size' => Size::MD->value,
],
 
'radio' => [
'size' => Size::MD->value,
],
 
'rating' => [
'size' => Size::MD->value,
],
 
'textarea' => [
'border-radius' => BorderRadius::RoundedSm->value,
],
 
'toggle' => [
'border-radius' => BorderRadius::RoundedSm->value,
],
 
'markdown' => [
'config' => [
'spellChecker' => false,
'autofocus' => false,
'uploadImage' => false, // add drag & drop image upload feature
'imageAccept' => 'image/png, image/jpeg, image/gif, image/avif',
'minHeight' => '150px',
'maxHeight' => '400px',
'toolbar' => [
'bold',
'italic',
'heading',
'|',
'quote',
'unordered-list',
'ordered-list',
'|',
'link',
// 'image', // display image markdown syntax
'upload-image', // open browser file window to upload image
'table',
'|',
'preview',
'side-by-side',
'fullscreen',
'|',
'guide',
],
],
],
];