-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use in vanilla html? #347
Comments
Hey, @axelthat2 I checked out your repo (thanks for providing a reproduction of the issue!) and it seems like a simple case of using the incorrect functions/API to set up the components properly. Change your import { provideVSCodeDesignSystem, vsCodeButton } from "@vscode/webview-ui-toolkit"
provideVSCodeDesignSystem().register(vsCodeButton()); Also if you want to use other components, simply import the desired component function (always in the form import {
provideVSCodeDesignSystem,
vsCodeButton,
vsCodeCheckbox,
// Import other component functions –– always in the form `vsCode{ComponentName}`
} from "@vscode/webview-ui-toolkit"
provideVSCodeDesignSystem()
.register(
vsCodeButton(),
vsCodeCheckbox(),
// Register other component functions here
); |
I'm also going to go ahead and close this issue and open a new one about updating our documentation to better highlight this information since up to this point this method of using the toolkit components isn't that well documented, except in fairly deep issue threads and also in the FAST getting started guide (which I don't expect most toolkit users to ever see). With that said, if you have any more questions, comments, concerns, etc. about this specific issue feel free to add more comments to this thread and I'll keep an eye on it over the next couple of days! |
Thank you so much. That helps a lot. I tried going through the toolkit docs and couldn't find anything. Adding doc for this issue will be so much great. Again thank you for your swift response. |
You're welcome, happy to hear it was helpful! |
Describe the bug
When I try to use the vscode webview components in my vanilla app, I get the error,
To reproduce
git clone https://github.com/axelthat2/vscode-bug
Expected behavior
Web components to work.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: