Skip to content

Provide the item rendering support for SSR mode of Virtualize component#66839

Open
Yuvan111 wants to merge 11 commits into
dotnet:mainfrom
Yuvan111:feature-57130-ssr-virtualize
Open

Provide the item rendering support for SSR mode of Virtualize component#66839
Yuvan111 wants to merge 11 commits into
dotnet:mainfrom
Yuvan111:feature-57130-ssr-virtualize

Conversation

@Yuvan111

@Yuvan111 Yuvan111 commented May 26, 2026

Copy link
Copy Markdown

Provide the item rendering support for SSR mode of Virtualize component

Description

Added a new InitialItemCapacity parameter to the Virtualize component to control the number of items rendered on initial load before viewport measurement.

Introduced a private _isInteractive flag instead of relying on RenderInfo because setting the render mode in OnParametersAsync triggers an initial prerender phase. This causes Virtualize to initialize before JS measurements are available, leading to test failures. The flag ensures virtualization runs only in the interactive state.

Before:

The component had no way to specify the initial item count upfront Initial rendering during SSR could produce suboptimal output since there was no client measurement Empty space might appear before scrolling in interactive modes.

image

After:

Developers can configure how many items render initially via InitialItemCapacity (defaults to 20)
SSR mode uses this value to generate appropriate initial HTML based on ItemSize and container height
Interactive modes apply this only until the viewport is measured, then adapt automatically
Reduces visible empty space on initial load.

image

Fixes #57130

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label May 26, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @Yuvan111. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label May 26, 2026
@Yuvan111

Copy link
Copy Markdown
Author

@dotnet-policy-service agree company="Syncfusion, Inc."

@Yuvan111 Yuvan111 marked this pull request as ready for review June 18, 2026 06:01
@Yuvan111 Yuvan111 requested a review from a team as a code owner June 18, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Virtualize + SSR support

1 participant