In order to create a blade, you first need to create an application and then create a bladeset (although we plan to make bladesets optional in the future).
There are two ways to create a blade
- Via the Command Line Interface (CLI) or
- Via the Web dashboard
We will go through both these ways below. Remember, you only need to follow one of the options as they both achieve the same thing.
Option 1. Creating a blade via the CLI
Once you have an application and a BladeSet you can create a Blade as follows:
$ ./brjs create-blade <app-name> <bladeset-name> <blade-name>
The following command will create a Blade called
input in the
todo BladeSet which is part of the
$ ./brjs create-blade brjstodo todo input
input blade is represented on disk by a directory called
input that resides under the directory called
blades in the
brjstodo app directory.
Option 2. Creating an app using the web dashboard
Start the BRJS development server by by entering the following on the command line:
and navigate to
http://localhost:7070. Click on the relevant app and select ‘Add blade’.
This example follows on from those in How to Create an App and How to Create a Bladeset where we created an app called
brjstodo and a bladeset called
We are now going to create a blade called
input within the
Hover over the bladeset box to make the bladeset options visible. Two options will show “Add Blade” and “Run Tests”
Click on “Add Blade” to bring up the below window.
Enter the blade name ‘input’.
You will now see the name of the new blades displayed underneath the bladeset name.
This creates a
input directory within
BRJS_HOME/brjs-apps/brjstodo/todo-bladeset/blades/ containing the following sub-directories:
tests- for the blade tests
themes- for CSS and images
workbench- for the Workbench for the Blade we're developing
resources- for everything else
- A default blade will be created when an application is created
- The CLI will be context aware so you can run
brjs create-bladefrom within an application directory to create a blade for an app; you won't need to supply an app name, app namespace and bladeset name