[SvelteKit UI Kit] Material Design integrate SvelteKit
Material Design
Material Design is an adaptable system of guidelines, components, and tools that support the best practices of user interface design. Backed by open-source code, Material streamlines collaboration between designers and developers, and helps teams quickly build beautiful products.
SvelteKit is a framework for building web applications of all sizes, with a beautiful development experience and flexible filesystem-based routing.
Prerequisites
-
Node.js - https://nodejs.org/en/
Node.js® is a JavaScript runtime built on Chrome’s V8 JavaScript engine.
Install Node.js - https://nodejs.org/en/ CLI.
1
2Mac OS X
brew install nodeSee Node.js - https://nodejs.org/en/ to learn more about others OS.
Usages
Initialize SvelteKit app
1 | npm init svelte@next cloudolife-sveltekit-attractions-demo |
Install Material Components for the web
Material Components for the web can be installed locally using npm.
1 | It is available as a single all-in-one package: |
Load the precompiled all-in-one CSS and JS
To try Material Components for the web with minimal setup, load the precompiled all-in-one CSS and JS bundles from unpkg or your self host.
1 | <!-- src/app.html --> |
Use MDC markup
1 | <!-- src/routes/index.svelte --> |
Run
1 | npm run dev -- --open |
It will open brower and visit http://localhost:3000.
References
[1] Getting Started - Material Design - https://material.io/develop/web/getting-started
[2] SvelteKit • The fastest way to build Svelte apps - https://kit.svelte.dev/
[3] Getting started | Docs • SvelteKit - https://kit.svelte.dev/docs#introduction-getting-started
[4] Svelte • Cybernetically enhanced web apps - https://svelte.dev/
[5] Homepage - Material Design - https://material.io/
[7] Material Components - https://github.com/material-components