Can I use the UI-library with templates? All the d...
# help-with-umbraco
d
If you go to the github repo of the ui library: https://github.com/umbraco/Umbraco.UI/tree/v1/contrib/packages/uui You'll find this snippet:
Copy code
html
<!-- Latest Version -->
<script src="https://cdn.jsdelivr.net/npm/@umbraco-ui/uui@latest/dist/uui.min.js"></script>

<!-- Specific version -->
<script src="https://cdn.jsdelivr.net/npm/@umbraco-ui/uui@X.X.X/dist/uui.min.js"></script>
Just including this script tag, should be enough to make all the UUI components available on your razor template. If you link directly to the cdn, you should also add a subresource integrity hash to the script tag.
d
Looks like I'm trying to do it in a way that isn't supported. An npm package of the ui-library is what I wanted. I also wanted to try out the UI components outside of umbraco. I should have been more specific, I wanted to use npm and have code hosted locally, not via a CDN. Sometimes I work where I have no internet. Currently getting a ot of errors installing with NPM to do with the Lerna package. Think I'll drop this for now.
Actually never mind, seems like it was a WIndows issue locally, npm i @umbraco-ui/uui worked fine after changing network in the office. Probably a brannmur issue.
8 Views