This file provides guidance to Claude Code (claude.ai/code) when working with code and documentation in this repository.
This is the Vaadin Documentation repository. It contains documentation for all Vaadin products, both open source and commercial.
The main branch is main. Always target main when creating pull requests, unless explicitly told to target another branch. Do not target latest — it is a tag, not a branch.
- .github/styles/ - Configuration files for Vale, which define the writing style guide and formatting rules for the documentation.
- articles/ - the actual documentation, written in AsciiDoc.
- src/ - compilable Java source code examples that can be referred to from the documentation articles.
- frontend/ - TypeScript/frontend code examples that can be referred to from the documentation articles.
- dspublisher/ - Configuration files for Vaadin Design System Publisher, which is used to build the documentation website.
# Clean
npm run dspublisher:clean
# Start the documentation server
npm run dspublisher:start
# Build the documentation for production
npm run dspublisher:build
# Run ESLint on frontend code
npm run lint
# Clean Maven build artifacts
mvn cleanEach .adoc file starts with YAML front matter between --- delimiters:
---
title: Page Title
order: 10
page-title: SEO Title - Vaadin Docs
meta-description: A 150-160 character description for search engines.
---- title: The page title displayed in navigation and as the main heading
- page-title: Browser tab title, 50-60 characters, should include "Vaadin"
- meta-description: Search engine description, 150-160 characters
- description: Subtitle shown below the title
- order: Numeric value controlling the page's position in navigation
- layout: Page layout template
- section-nav: Navigation behavior (e.g.,
badge) - page-links: Related links shown on the page
- Java examples:
src/main/java/com/vaadin/demo/ - TypeScript examples:
frontend/demo/
Use tags to mark extractable code sections:
// tag::snippet[]
Button button = new Button("Click me");
button.addClickListener(e -> Notification.show("Clicked!"));
// end::snippet[]Hidden Lines
Hide boilerplate code that clutters the documentation:
public class Example extends Div {
public Example() {
Button button = new Button("Click me"); // hidden-source-line
add(button);
}
}Lines with // hidden-source-line are not displayed in documentation but are compiled.
For rendered examples, include an inner exporter class:
public class ButtonExample extends Div {
public ButtonExample() {
// Example code here
}
public static class Exporter extends DemoExporter<ButtonExample> {} // hidden-source-line
}Use the include directive with the {root} attribute for absolute paths:
[source,java]
----
include::{root}/src/main/java/com/vaadin/demo/component/button/ButtonBasic.java[render,tags=snippet,indent=0]
----Common include options:
render- Renders a live demotags=snippet- Includes only tagged sectionsindent=0- Removes indentation
Use compilable source files (included via include::{root}/) when:
- Code needs to be rendered as a live, interactive demo (uses
renderattribute) - Same example should be shown in multiple frameworks (Flow/Lit/React variants)
- Code is complex or long (typically 30+ lines) and benefits from compilation testing
- It's a reusable reference implementation for a component feature
- Writing component documentation (articles/components/)
Use inline code when:
- Showing design patterns or architectural concepts rather than specific features
- Snippets are short and illustrative (typically under 30 lines)
- Examples are configuration (properties, XML, CSS, annotations)
- Writing how-to guides or deep dives where the focus is education, not live demos
- Code is pseudo-code or conceptual - showing intent, not a complete implementation
- Multiple small variations are easier to compare side-by-side inline
- Purpose: Show how to achieve specific goals
- Tone: Practical, opinionated, production-ready
- Focus: Common use cases, best practices, pitfalls to avoid
- Code: Copy-paste ready snippets at the top when applicable
- Purpose: Document features, APIs, and capabilities
- Tone: Neutral, factual, complete
- Focus: What features exist, what they do, how to use them
- Code: Technical, API-focused examples
- Purpose: Explore concepts and reasoning
- Tone: Conceptual, insightful, opinionated
- Focus: Why certain practices exist, alternative approaches
- Code: Illustrative examples supporting concepts
- Use present tense (avoid "will")
- American English spelling (customize, color, behavior)
- Professional, friendly tone
- Title case for headings
- Use Oxford comma in lists (a, b, and c)
The repository uses Vale for automated style checking. Configuration is in .vale.ini, and style rules are in the .github/styles/ folder.
Avoid explicit Vaadin version numbers in text. Instead, use version badges:
[since:com.vaadin:vaadin@V24]This keeps documentation version-agnostic and maintainable.
Environment setup and tutorials for new users. After completing these, users should be ready for the Building Apps guides.
Action-oriented, opinionated how-to guides for building business applications. Focus on essentials, common use cases, pitfalls, and practical tips. Include copy-paste ready code snippets at the top when applicable.
Also contains deep dive articles that explore concepts, reasoning behind practices, and alternative approaches.
Vaadin Framework reference documentation. Technical, code-centric, unopinionated API documentation describing features and usage. Forms the foundation for Building Apps articles.
Note: Legacy content exists here from when this contained all framework docs. Old tutorials and how-to content should be migrated to Building Apps.
Hilla framework documentation (discontinued). Relevant content should be migrated to articles/flow as features merge into Vaadin.
Component documentation covering capabilities, usage, and styling for each Vaadin component.
General styling guidance for Vaadin applications.
Documentation for official Vaadin tools.