Setup
How to install Webcore
Webcore can be used as a standalone project, or it can be integrated into your existing Astro, Svelte, or React ecosystems. The easiest way to get started is to run the following command in your terminal, and follow the prompts:
npm create webcore@latestnpm create webcore configYou can also clone the repository and run npm run dev to start building your pages with the components available.
Using a Template
If you want to use one of our templates, you can run the following command in your terminal:
npm create webcore@latest template [TemplateName] [destination]
# Use the "Portfolio" template on the current directorynpm create webcore@latest template Portfolio
# Create the "Portfolio" template in the "portfolio" directorynpm create webcore@latest template Portfolio ./portfolioYou can find the list of available templates in our GitHub repository. When using the CLI, make sure you reference the name of the template folder.
Manual Install
If you’re looking for specific instructions on how to integrate Webcore into your techstack, we recommend reading through our integration guides:
Webcore components use Sass for styling and TypeScript for type safety. To use the component library, make sure you have the following packages installed:
- Sass -
v1.9 - TypeScript -
v5.8
You can use the following command in your terminal to installed the above packages if you don’t have them already:
npm i sass typescriptyarn add sass typescriptThe library can be used with Astro, Svelte, and React. Depending on your project setup, you’ll also need the following packages:
-
Installation
Install Webcore as a dependency by running the following command:
npm i webcoreuiyarn add webcoreui -
Setup Configurations
Add an empty
webcore.config.scssfile at the root of your project. You can read more about how you can configure your CSS using this file in the CSS Configuration section.Setup default styles and fonts by calling the following in your global SCSS file:
@use 'webcoreui/styles' as *;@include setup((// Define paths for your fontsfontRegular: '/fonts/Inter-Regular.woff2',fontBold: '/fonts/Inter-Bold.woff2'));You can download the fonts Webcore uses from thepublic/fontsdirectory.You’ll also need to add the following integration to your Astro configuration file at the root of your project directory:
astro.config.mjs import { webcore } from 'webcoreui/integration'export default defineConfig({integrations: [webcore()]}) -
Using Components
That’s it! You’re all set to start using Webcore components in your Astro project:
pages/index.astro ---import { Alert } from 'webcoreui/astro'---<Alert theme="info">Webcore is ready</Alert>
Request improvement for this page