PHPackages                             viget/craft-parts-kit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. viget/craft-parts-kit

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

viget/craft-parts-kit
=====================

1.0.0(6mo ago)058[5 issues](https://github.com/vigetlabs/craft-parts-kit/issues)1mitPHPPHP &gt;=8.2

Since Oct 3Pushed 6mo ago4 watchersCompare

[ Source](https://github.com/vigetlabs/craft-parts-kit)[ Packagist](https://packagist.org/packages/viget/craft-parts-kit)[ RSS](/packages/viget-craft-parts-kit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (9)Used By (1)

Craft CMS Parts Kit Plugin
==========================

[](#craft-cms-parts-kit-plugin)

A simple component library plugin for Craft CMS (think [Storybook](https://storybook.js.org/) or [Fractal](https://fractal.build/)).

It uses Craft's built-in Twig rendering and does not depend on build tools or npm packages.

This plugin scans your `templates/parts-kit` directory and serves a prebuilt UI that loads each component in an iframe.

The UI is provided by Viget's [Parts Kit Web Component](https://github.com/vigetlabs/parts-kit). A minimal UI that renders components in an iframe.

    CleanShot.2025-09-19.at.15.24.08.mp4    Key features
------------

[](#key-features)

- Low abstraction: render with your real Twig templates
- Zero-build tools: Simply add Twig files to the `templates/parts-kit` directory.
- Clean URLs for each part (e.g. `/parts-kit/button/default`)

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 5.0.0 or later, and PHP 8.2 or later.

Installation
------------

[](#installation)

You can install this plugin from the Craft Plugin Store (Coming Soon) or with Composer.

### From the Plugin Store (Coming Soon)

[](#from-the-plugin-store-coming-soon)

Go to the Plugin Store in your project’s Control Panel and search for “Parts Kit”. Then press “Install”.

### With Composer

[](#with-composer)

Open your terminal and run the following commands:

```
# go to the project directory
cd /path/to/my-project

# tell Composer to load the plugin
composer require viget/craft-parts-kit

# tell Craft to install the plugin
craft plugin/install parts-kit
```

Setup &amp; Usage
-----------------

[](#setup--usage)

1. Create templates in `templates/parts-kit` (examples below).
2. (Optional) Create a configuration file at `config/parts-kit.php` to customize settings.
3. Visit `/parts-kit` on your site. The plugin registers this route and renders the UI.

That's it. The UI fetches its config from the plugin's JSON endpoint and lists your parts automatically.

Configuration
-------------

[](#configuration)

You can customize the plugin's behavior by creating a `config/parts-kit.php` file in your project:

```
