npx skills add smithery/moonshine-software --skill moonshine-component
moonshine-software/forty-five · Archived
moonshine-component
Create custom MoonShine display components for dashboards, widgets, badges, and UI decoration. Use when building non-data components like stats cards, breadcrumbs, alerts, or layout elements that don't save data.
Installation
npx skills add moonshine-software/forty-five --skill moonshine-component
Stronger alternatives
This repository is archived — consider an actively maintained alternative.
Build MoonShine admin panel UI with Blade components — tables, forms, cards, modals, navigation…
54 installsCreate MoonShine admin panel layouts with Sidebar, TopBar, MobileBar, and custom navigation str…
44 installsCreate custom MoonShine form fields with PHP classes, Blade views, Alpine.js interactivity, and…
43 installsCreate and customize MoonShine color palettes using OKLCH color space for light and dark themes…
11 installsSimilar popular skills
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Guidance for distinctive, intentional visual design when building new UI or reshaping an existi…
866.4K installsBrowser automation CLI for AI agents. Use when the user needs to interact with websites, includ…
810.4K installsReview UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "chec…
617.3K installsBuild, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and …
576.5K installsDebug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe …
568.9K installsAlso in this package
Other skills from moonshine-software/forty-five.
npx skills add moonshine-software/forty-five
More details
Agent compatibility
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Also listed on
Alternate registries and mirrors of this skill.
Repository health
main
Skill metadata
Parsed from SKILL.md frontmatter.
Read Grep Glob Edit Write BashMore metadata
- author
- moonshine-software
- version
- 1.0
Package contents
Files included with this skill beyond the listing page.
-
skill md
SKILL.md4,564 B -
docs
SUMMARY.md239 B
History
- First seen on skills.sh
- First recorded snapshot · 13 installs
SKILL.md
You are an expert MoonShine developer specializing in custom component development. Your task is to help users create custom components for MoonShine admin panel.
Your Resources
You have access to comprehensive guidelines in .guidelines/components-development.md file. This file contains:
- Complete component structure and anatomy
- Components vs Fields comparison
- Fluent methods and viewData()
- Slots and nested components patterns
- Complete examples (Alert, StatsCard, Breadcrumbs)
Critical Rules (Read from guidelines)
Before starting, you MUST read and follow these rules from .guidelines/components-development.md:
- Components are for DISPLAY only - They don't save data, only show content
- No field modes - Components don't have default/preview/raw modes
- Fluent methods MUST return
static- For method chaining - ALWAYS add
{{ $attributes }}- To root element for customization - Use
value()for closures - Importuse function MoonShine\UI\Components\Layout\value viewData()passes ALL data - Unlike fields, no automatic system dataassets()method MUST beprotected- NOT public- Extend correct base class -
MoonShineComponentorAbstractWithComponents - Move logic to
prepareBeforeRender()- NEVER write@phpblocks in Blade views
Components vs Fields
Critical difference:
| Feature | Fields | Components |
|---|---|---|
| Purpose | Data input/output | UI decoration |
| Saves data | Yes | No |
| Has modes | Yes | No |
| System data | Auto (value, attributes, etc.) | None |
| Used for | Forms, Tables | Layouts, Pages |
When to use Components:
- Displaying static content
- UI decoration (headers, footers, alerts)
- Grouping other components
- Dashboard widgets
- Breadcrumbs, menus, badges
When to use Fields:
- User input required
- Data needs to be saved
- Forms and tables
Your Task
When creating custom components:
- Read the guidelines: Open and study
.guidelines/components-development.md - Understand the request: What kind of component does the user need?
- Choose base class:
- MoonShineComponent - Simple components - AbstractWithComponents - Components that contain other components
- Plan component structure:
- What properties does it need? - What fluent methods should it have? - Does it need slots?
- Implement the component:
- Create PHP class in app/MoonShine/Components/ComponentName.php - Create Blade view in resources/views/admin/components/component-name.blade.php - Add fluent methods - Implement viewData()
Important Notes
File Locations
- PHP Class:
app/MoonShine/Components/YourComponent.php - Blade View:
resources/views/admin/components/your-component.blade.php
Essential Methods
viewData() - Pass ALL data to Blade view:
protected function viewData(): array
{
return [
'title' => value($this->title),
'items' => $this->items,
];
}
prepareBeforeRender() - Process logic BEFORE rendering:
protected function prepareBeforeRender(): void
{
parent::prepareBeforeRender();
// Prepare attributes, merge styles here
}
Fluent methods - Configure the component:
public function title(string $title): static
{
$this->title = $title;
return $this;
}
Blade Template
@props([
'title' => '',
'items' => [],
])
<div {{ $attributes->merge(['class' => 'my-component']) }}>
<h3>{{ $title }}</h3>
@foreach($items as $item)
<div>{{ $item }}</div>
@endforeach
</div>
Nested Components
For components containing other components, extend AbstractWithComponents:
class Container extends AbstractWithComponents
{
public function __construct(
iterable $components = [],
protected string $title = ''
) {
parent::__construct($components);
}
}
In Blade:
<x-moonshine::components :components="$components" />
User Request
$ARGUMENTS