Skip to content

enhancement: add class to VirtualList#972

Open
davedbase wants to merge 2 commits into
solidjs-community:nextfrom
davedbase:v2/virtual-list-class
Open

enhancement: add class to VirtualList#972
davedbase wants to merge 2 commits into
solidjs-community:nextfrom
davedbase:v2/virtual-list-class

Conversation

@davedbase

@davedbase davedbase commented Jul 6, 2026

Copy link
Copy Markdown
Member

Added an optional class prop to <VirtualList>, applied to the internal wrapper that holds the rendered rows. This lets consumers lay out rows with flexbox/grid (e.g. display: flex; flex-flow: column; width: 100%;) instead of styling each row individually — resolves #698.

  • Removed the unused packages/virtual/dev/ demo folder.
  • Added a Storybook story ("Styling rows with class") demonstrating the new prop with a flex-column row layout and uniform gaps.
  • Updated the README: documented the class prop, and fixed a pre-existing example bug where createVirtualList's <For> usage called item() without keyed={false} — added an explanation that <For> defaults to keyed={true} (raw values) and needs keyed={false} to receive items as Accessors.
  • Added a test verifying class is applied to the row wrapper, and updated the SSR snapshot test (class={undefined} still serializes as class="" under @solidjs/web's SSR renderer).

Summary by CodeRabbit

  • New Features

    • <VirtualList> now supports a class prop, making it easier to style the rows wrapper.
    • Added a new example showing how to apply custom row layout styling.
  • Documentation

    • Updated usage docs to clarify how visibleItems should be rendered.
    • Expanded styling guidance with CSS and TSX examples.
  • Bug Fixes

    • Improved rendering behavior in list examples and updated expected server-rendered output for the new class support.
  • Tests

    • Added coverage to verify the new styling prop is applied correctly.

@davedbase davedbase added this to the Solid 2.0 Migration milestone Jul 6, 2026
@davedbase davedbase added the enhancement New feature or request label Jul 6, 2026
@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 81db4ef

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solid-primitives/virtual Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c66936fe-b264-44ff-b443-bd12675a72b9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant