Set up a component generator

Install the component generator in your workspace. For example:

$bit
Copiedcopy

Configure the generator in the relevant env:

/* @filename: my-env.bit-env.ts */

import { TemplateList } from '@teambit/generator';
/* import the generator */
import { ReactComponentTemplate } from '@teambit/react.generator.react-templates';

export class MyEnv {
  generators() {
    return TemplateList.from([ReactComponentTemplate.from()]);
  }
}
CopiedCopy

Set an env as a default for generators (templates)

Configure the env as a component template provider in your workspace.jsonc:

/* @filename: workspace.jsonc */ 
{
  {
    "teambit.generator/generator": {
      "envs": ["my-org.my-scope/my-env"]
    }
  }
}
CopiedCopy