Svelte Component Template screenshot

Svelte Component Template

Author Avatar Theme by Yoglib
Updated: 25 Jul 2022
336 Stars

A highly-opinionated base for building shareable Svelte 3 components

Categories

Overview: The Svelte 3 Component Template is a highly-opinionated base for building shareable Svelte 3 components. It provides a set of features and guidelines to facilitate the development of Svelte components.

Features:

  • Preprocessing: The template leverages svelte-preprocess for handling preprocessing tasks.
  • Formatting: The template includes pre-made formatting scripts to ensure consistent code style.
  • Linting: Linting tools are integrated into the template for identifying and fixing code issues.
  • Storybook: The template supports Storybook, which allows for interactive component development and testing.
  • Testing: The template provides both interaction testing and snapshot testing capabilities.
  • Publishing to npm: The template offers guidelines for preparing and publishing Svelte components to npm registry.

Installation: To get started with the Svelte 3 Component Template, follow these steps:

  1. Clone the template using either of the following options:

    • Option #1: Clone it with Github’s “Use this template” option.
    • Option #2: Clone this repository with degit.
  2. Navigate to the template folder.

  3. Initiate Git in the folder.

  4. Install the project dependencies.

  5. Configure the package.json file.

  6. Start coding: Your component’s source code should be placed in the src/lib/[MyComponent]/[MyComponent].svelte file.

Summary: The Svelte 3 Component Template is a useful resource for developers looking to build shareable Svelte components. It provides a comprehensive set of features and guidelines, including preprocessing, formatting, linting, testing, and publishing to npm. By following the installation guide, developers can quickly start developing components using the template.