Skip to content

Commit ad33829

Browse files
committed
updated contributing to incude section on using the snippets
1 parent e60c2ac commit ad33829

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,26 @@ npm install
3535
npm start
3636
```
3737

38+
## Creating a new component (quick start)
39+
40+
The best way to get started with a new component is to use our snippets for scaffolding:
41+
42+
> Note: The steps below assume you are using Visual Studio Code and you've installed all the recommended extensions.
43+
44+
1. Chose a name for your component. The component must be prefixed with `mgt`. For example `mgt-component`
45+
46+
1. Create a new folder for your new component under `src` \ `components` and name it with the name of your component.
47+
48+
1. Create a new typescript file in your new folder with the same name. Ex: `mgt-component.ts`
49+
50+
1. Open the file and use the `mgtnew` snippet to scaffold the new component.
51+
52+
> To use a snippet, start typing the name of the snippet (`mgtnew`) and press `tab`
53+
54+
1. Tab through the generated code to set the name of your component.
55+
56+
1. Add your code!
57+
3858
<!-- ## Testing the preview NPM package
3959
4060
If you want to install the preview package just once, run this command:

0 commit comments

Comments
 (0)