Skip to Content
The Public InterfaceSeptember 12, 2026

The Public Interface

August 3, 2023

Document Svelte Projects with HTML and JSDoc Comments

Use documentation comments to thoroughly document your Svelte code.

By Ross Robinosvelte / documentation / jsdoc

Documenting code with JSDoc comments not only simplifies the lives of maintainers and consumers, but it also offers several advantageous alternatives to regular comments. JSDoc comments enable hints to appear in convenient locations, making code documentation even more valuable. In this article, we will explore a few effective methods to document Svelte code using HTML and JSDoc comments.

Entire Svelte components can be documented with HTML comments that include @component.

Svelte FAQ

You can utilize markdown syntax in this comment to write documentation. It will appear when the user hovers over the name of the component in most editors like VSCode.

JSDoc isn’t just for the no build step crowd, TypeScript developers can also take advantage of it to document their work. Add a JSDoc comment (/** comment */) above any variable or type definition to document it with markdown syntax. When props are documented, you can hover over each prop when utilizing the component to read the documentation.

Finally, variables and functions can also be thoroughly documented. This enables developers to clearly understand the purpose and expected outcome of each function. Furthermore, markdown code blocks can be utilized to include examples. For the full list of options, check out the JSDoc Documentation.…

Continue reading

In brief

Write Once, Run Anywhere

Write one schema in JavaScript and query data on the edge with Drizzle-ORM, SvelteKit, and Vercel Storage.

At the time of this writing, Drizzle has not reached 1.0. Check out tools like Prisma for a production ready solution. Updated May 9th, 2024

May 1, 2023

Use Zod to Validate Forms on the Server with SvelteKit

Render issues from Zod with a Svelte component.

Zod is a schema validation library that works nicely with SvelteKit. It provides an easy API to quickly validate forms across an application with reusable schemas. Many popular projects use Zod to accomplish type checking at runtime. The Astro team uses Zod in their Content Collections feature to validate Markdown frontmatter. It can also be used with TypeScript or JavaScript. Here’s how to use Zod to validate forms on the server with SvelteKit. First create a new SvelteKit project and then add Zod as a development dependency.

March 25, 2023

Use TypeScript with SvelteKit and Supabase

Focus on writing product code with this powerful pair of tools.

It’s hard to avoid adding lots of different dependencies when creating a full-stack web application. Many projects use separate packages for rendering, routing, data fetching, creating an API, managing state, hosting a database/storage, and setting up authentication. Lee Robinson recently wrote Why You Should Use a React Framework, in this post he highlights how developers should spend their time writing code that is unique to their application, and less time writing boilerplate to connect tools together. I believe we can take this one step further by utilizing SvelteKit, and even further by pairing it with Supabase. SvelteKit is the first party framework and the recommended way to build Svelte applications. Among other features, it provides a powerful way to load data and render pages server side.

February 1, 2023

External dispatch

Archive