Import the Hero UI example into the project.

Introduction

This template provides a reusable setup for importing Hero UI components, fully integrated with Croct for content management, AB testing, and real-time personalization.

It supports downloading code, configuring slots, and extending functionality with additional actions. If the current directory does not contain a project, the template creates a new one using Next.js.

Usage

Here is an example of how to use this template:

{  "name": "import",  "template": "hero-ui://component/component",  "options": {    "id": "animated-list",    "slotId": "slotId",    "slotVersion": "slotVersion",    "components": ["notification-list.tsx"],    "extension": "hero-ui://component/cookie-consent/extension.json5"  }}

Options

OptionDescriptionTypeRequiredDefault
idA unique identifier for the Hero UI component, as defined in the registry.stringYes
versionThe version of Next.js to use when generating a new project.stringNolatest
routerThe router format to use (app or page).stringNoapp
slotIdThe variable name that holds the slot ID created or used by the template.referenceNo
slotVersionThe variable name that holds the version of the slot.referenceNo
componentsA list of component files to download and include in the project.arrayNo
extensionThe URL of an extension template to apply.No-

Start building in seconds

Paste the following command in your terminal and let the CLI do the rest.

npx croct@latest init