diff --git a/packages/webawesome/docs/_layouts/component.njk b/packages/webawesome/docs/_layouts/component.njk index c5210042d..b6dd8d18d 100644 --- a/packages/webawesome/docs/_layouts/component.njk +++ b/packages/webawesome/docs/_layouts/component.njk @@ -23,6 +23,37 @@ {# Component API #} {% block afterContent %} + {# Importing #} +
+ Autoloading components via projects is the recommended way to import components. If you prefer to do it manually, use one of the following code snippets. +
+ + {% set componentName = component.tagName | stripPrefix %} + {% set componentPath = ["components/", componentName, "/", componentName, ".js"] | join("") %} ++ Let your project code do the work! Sign up for free to use a project with your very own CDN — it's the fastest and easiest way to use Web Awesome. +
++ To manually import this component from NPM, use the following code. +
+import '@awesome.me/webawesome/dist/{{ componentPath }}';
+ + To manually import this component from React, use the following code. +
+import {{ component.name }} from '@awesome.me/webawesome/dist/react/{{ componentName }}';
+ - Autoloading components via projects is the recommended way to import components. If you prefer to do it manually, use one of the following code snippets. -
- - - {% set componentName = component.tagName | stripPrefix %} - {% set componentPath = ["components/", componentName, "/", componentName, ".js"] | join("") %} -- Let your project code do the work! Sign up for free to use a project with your very own CDN — it's the fastest and easiest way to use Web Awesome. -
-- To manually import this component from NPM, use the following code. -
-import '@awesome.me/webawesome/dist/{{ componentPath }}';
- - To manually import this component from React, use the following code. -
-import {{ component.name }} from '@awesome.me/webawesome/dist/react/{{ componentName }}';
-