Skip to content

Component Overview

Lartrix provides 120+ components covering various admin development scenarios.

Component Categories

CategoryDescriptionCount
NaiveUIBasic UI components100+
BusinessBusiness components10+
CommonCommon components10+
CustomCustom components10+
JsonJSON components2

Naming Convention

NaiveUI Components

PHP class names have no N prefix, but output retains N prefix:

PHP ClassOutput Component
Button::make()NButton
Input::make()NInput
SwitchC::make()NSwitch
EmptyState::make()NEmpty

SwitchC Explanation

Switch is a PHP reserved keyword, so we use SwitchC.

Basic Usage

php
use Lartrix\Schema\Components\NaiveUI\Button;

$button = Button::make('Click Me')
    ->type('primary')
    ->props(['size' => 'large'])
    ->on('click', SetAction::make('visible', true));

Method Chaining

All components support method chaining:

php
Card::make()
    ->title('Card Title')
    ->children([
        Input::make()
            ->props(['placeholder' => 'Enter text'])
            ->model('form.name'),
        Space::make()
            ->children([
                Button::make('Cancel'),
                Button::make('Save')->type('primary'),
            ]),
    ]);

Detailed Documentation

基于 MIT 许可发布