Download the PHP package viget/craft-parts-kit without Composer

On this page you can find all versions of the php package viget/craft-parts-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-parts-kit

Craft CMS Parts Kit Plugin

A simple component library plugin for Craft CMS (think Storybook or Fractal).

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/user-attachments/assets/b1205f58-1d8b-4c73-9bad-60b3e6eb2015

Key features

Requirements

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

Installation

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

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

Open your terminal and run the following commands:

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

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

Example Head Template

Create a partial at templates/_partials/head.twig:

This partial will be automatically included in the <head> of each parts kit page. You can also include this same partial in your main site layout to ensure consistency.

Creating & Organizing Your Parts (Twig templates)

Create Twig templates under templates/parts-kit. Folders become navigation groups; files become pages. File and folder names are humanized for display.

Hidden files/folders (names starting with a dot) are ignored. Root-level index.twig/index.html are also ignored.

Example tree

Each file is rendered at a clean URL that mirrors the path without the extension. For example:

The Parts Kit plugin provides an Action URL that returns a JSON config used by our Parts Kit UI.

Show Example JSON

Example Usage in Templates

Create a file in the templates/parts-kit/button/default.twig directory and simply import and render your component:

That's it! No need to extend layouts or wrap your code in blocks.

Testing

The plugin uses Codeception with Craft's testing framework. Tests run against a real Craft instance, so a database is required.

  1. Install the dev dependencies:

  2. Create a craft_test database (MySQL or PostgreSQL).

  3. Copy the matching env example to tests/.env and fill in your database credentials:

  4. Run the suite:

Once the suite has run at least once, add --env fast to skip the database rebuild between runs (e.g. ./vendor/bin/codecept run unit --env fast).

Continuous integration runs the suite on PHP 8.2 against MySQL and PostgreSQL for every pull request and pushes to main (see .github/workflows/ci.yml).

Local development with DDEV

This repo ships a DDEV harness so you can boot a real Craft CMS install with the plugin loaded and live-editable. The plugin source lives at the repo root; a full Craft app lives in craft-install/ and loads the plugin via a Composer path repository (a symlink), so edits to src/ are reflected immediately.

Getting started

Then visit:

The dev install ships a few sample parts under craft-install/templates/parts-kit/ and a craft-install/config/parts-kit.php that sets requireViewPermission => false, so /parts-kit is viewable anonymously without logging in. These dev-only files are excluded from the distributed plugin package and do not change the plugin's production defaults.

Useful commands

Gotcha: composer_root is set to . in .ddev/config.yaml, so ddev composer targets the plugin's root composer.json, not the Craft app. To manage Craft app dependencies, run them against craft-install/ explicitly:

Note: The browsing UI loads from the unpkg CDN, so the dev environment needs network access.

Credits

Built by Viget. The Parts Kit UI is powered by our JavaScript library documented at vigetlabs/parts-kit.


All versions of craft-parts-kit with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
craftcms/cms Version ^5.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package viget/craft-parts-kit contains the following files

Loading the files please wait ...