Advanced

Creating a Box

To create a Truffle Box you'll need a few things:

A GitHub repository

A configuration file

Optionally, small and large images for the box's listing

The configuration file and images belong in the top-level directory of your repo. With these files in place, and your repo on GitHub, the unbox command will be: truffle unbox {USER_NAME || ORG_NAME}/{REPO_NAME}

If you're starting from scratch, we've created a blueprint box containing a configuration file with common values, as well as template versions of the small and large images.

hooks (object)

An object containing console commands to execute once unboxed. Since we're working in Node.js, most commonly this will contain npm install.

"hooks": {
"post-unpack": "npm install"
}

Images

The large box image is a 512px square with 32px of padding on each side.

The small box image is 735px x 100px. There is 32px of padding on the left side of the banner, and it's minimum size (described in the template as "Min Banner Width") is 290px, including the left padding. The banners are fixed to the left side and crop off the right side as the window narrows.

If no images are provided in a box, we default to banners containing the Truffle logo:

Truffle Site Listing

Before being listed on the Truffle website, all boxes undergo a screening process to ensure compatibility with Truffle. To start the pre-screening process, send us an email with your desired box name and brief description, along with a link to its GitHub repo to: info@trufflesuite.com.