{"id":13532151,"url":"https://github.com/minht11/solid-virtual-container","last_synced_at":"2025-10-13T12:27:07.140Z","repository":{"id":104204900,"uuid":"382627417","full_name":"minht11/solid-virtual-container","owner":"minht11","description":"Virtual list/grid for solid-js","archived":false,"fork":false,"pushed_at":"2022-05-15T12:59:51.000Z","size":111,"stargazers_count":86,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-26T03:54:42.167Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minht11.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-07-03T13:52:46.000Z","updated_at":"2025-04-24T19:36:24.000Z","dependencies_parsed_at":"2024-01-14T02:01:53.068Z","dependency_job_id":null,"html_url":"https://github.com/minht11/solid-virtual-container","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"24f1f2e22f54f189969e3d7b0c003ee23ca33ccb"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/minht11/solid-virtual-container","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minht11%2Fsolid-virtual-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minht11%2Fsolid-virtual-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minht11%2Fsolid-virtual-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minht11%2Fsolid-virtual-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minht11","download_url":"https://codeload.github.com/minht11/solid-virtual-container/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minht11%2Fsolid-virtual-container/sbom","scorecard":{"id":648222,"data":{"date":"2025-08-11","repo":{"name":"github.com/minht11/solid-virtual-container","commit":"24f1f2e22f54f189969e3d7b0c003ee23ca33ccb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/16 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish-package.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-package.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/minht11/solid-virtual-container/publish-package.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-package.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/minht11/solid-virtual-container/publish-package.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/publish-package.yml:16","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-593f-38f6-jp5m","Warn: Project is vulnerable to: GHSA-x2rg-q646-7m2v","Warn: Project is vulnerable to: GHSA-jgmv-j7ww-jx2x","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-3qxh-p7jc-5xh6","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T12:44:20.438Z","repository_id":104204900,"created_at":"2025-08-21T12:44:20.438Z","updated_at":"2025-08-21T12:44:20.438Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015060,"owners_count":26085643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:01:08.576Z","updated_at":"2025-10-13T12:27:07.098Z","avatar_url":"https://github.com/minht11.png","language":"TypeScript","funding_links":[],"categories":["📦 Components \u0026 Libraries"],"sub_categories":["UI Components"],"readme":"# Virtual container for Solid-js\nEfficient, single direction virtual list/grid for Solid-js\n\n## Features\n* Support for grid/list modes.\n* Only render visible items, no matter how big is your list.\n* Keyboard navigation and focus management out of the box.\n* Option to change items size based on available space.\n\n[Demo](https://codesandbox.io/s/minht11solid-virtual-container-demo-pk74r)\n\n## Usage\n\n```\nnpm install @minht11/solid-virtual-container\n```\n\nCreate list item component.\n```tsx\nconst ListItem = (props) =\u003e (\n  \u003cdiv\n    // Required for items to switch places.\n    style={props.style}\n    // Use CSS to set width to 100% or any other value.\n    class='width-full'\n    // Used for keyboard navigation and accessibility.\n    tabIndex={props.tabIndex}\n    role=\"listitem\"\n  \u003e\n    \u003cdiv\u003e{props.item}\u003c/div\u003e\n  \u003c/div\u003e\n)\n```\nCreate vertically scrolling virtual list\n```tsx\nimport { VirtualContainer } from \"@minht11/solid-virtual-container\"\n\nconst App = () =\u003e {\n  const items = [0, 1, 2, 3]\n  let scrollTargetElement!: HTMLDivElement\n  return (\n    \u003cdiv style={{ overflow: 'auto' }} ref={scrollTargetElement}\u003e\n      \u003cVirtualContainer\n        items={items}\n        scrollTarget={scrollTargetElement}\n        // Define size you wish your list items to take.\n        itemSize={{ height: 50 }}\n      \u003e\n        {ListItem}\n      \u003c/VirtualContainer\u003e\n    \u003c/div\u003e\n  )\n}\n```\nor a virtual grid\n```tsx\nconst App = () =\u003e {\n  const items = [0, 1, 2, 3]\n  let scrollTargetElement!: HTMLDivElement\n  return (\n    \u003cdiv style={{ overflow: 'auto' }} ref={scrollTargetElement}\u003e\n      \u003cVirtualContainer\n        items={items}\n        scrollTarget={scrollTargetElement}\n        itemSize={{ height: 50, width: 50 }}\n        // Calculate how many columns to show.\n        crossAxisCount={(measurements) =\u003e (\n          Math.floor(\n            measurements.container.cross / measurements.itemSize.cross\n          )\n        )}\n      \u003e\n        {ListItem}\n      \u003c/VirtualContainer\u003e\n    \u003c/div\u003e\n  )\n}\n```\n\u003e You can control list items styling using regular CSS, including `width` and `height`, however properties defined using `itemSize` will take a priority.\n\n\u003e One dimensional lists require only main direction size be set using `itemSize`. For vertical scrolling that's `height` and for horizontal direction that's `width`. Multidimensional lists require both.\n## Api\n### ScrollTargetContext\nIf you you do not have an immediate access to the VirtualContainer, or do not want to pass props several components deep you can use context api.\n\n```tsx\nconst App = () =\u003e {\n  const items = [0, 1, 2, 3]\n  let scrollTargetElement!: HTMLDivElement\n  return (\n    \u003cdiv ref={scrollTargetElement}\u003e\n      \u003cScrollTargetContext.Provider value={{ scrollTarget: scrollTargetElement }}\u003e\n        ...\n        \u003cVirtualContainer ... /\u003e\n        ...\n      \u003c/ScrollTargetContext.Provider\u003e\n    \u003c/div\u003e\n  )\n}\n```\n### Virtual container options\n```tsx\ninterface VirtualContainer\u003cT\u003e {\n  // your list data array. \n  items: readonly T[]\n  // Define elements size.\n  // All elements will use same size.\n  itemSize: VirtualItemSize\n  // Scrolling element, if context api is used this is not needed,\n  // however you must use one or the other.\n  scrollTarget?: HTMLElement\n  // Scroll direction. Default is vertical.\n  direction?: 'vertical' | 'horizontal'\n  // Number of elements to render below and above currently visible items,\n  // if not provided an optimal amount will be automatically picked.\n  overscan?: number\n  // Container className, if at all possible ignore this option,\n  // because direct styling can break virtualizing, instead wrap\n  // element in another div and style that.\n  className?: string\n  role?: JSX.HTMLAttributes\u003cHTMLDivElement\u003e['role']\n  // Function which determines how many columns in vertical mode\n  // or rows in horizontal to show. Default is 1.\n  crossAxisCount?: (\n    measurements: CrossAxisCountOptions,\n    // The same as items.length\n    itemsCount: number,\n  ) =\u003e number\n  // List item render function.\n  children: (props: VirtualItemProps\u003cT\u003e) =\u003e JSX.Element\n}\n```\nIf `direction` is `vertical` main axis is vertical.\nIf `direction` is `horizontal` main axis is horizontal.\n```tsx\ninterface Axis {\n  // Main scrolling direction axis.\n  main: number\n  // Opposite axis to main.\n  cross: number\n}\n```\n\nParameter object used in `VirtualContainer.crossAxisCount` function.\n```tsx\ninterface CrossAxisCountOptions {\n  // Scrolling element dimensions.\n  target: Axis\n  // Container element dimensions.\n  container: Axis\n  // List element dimensions.\n  itemSize: Axis\n}\n```\n### Item size\n```tsx\n// You can use static object to define item size\ninterface VirtualItemSizeStatic {\n  width?: number\n  height?: number\n}\n\n// or use a function to calculate it when layout changes.\ntype VirtualItemSizeDynamic = (\n  crossAxisContentSize: number,\n  // Scroll direction.\n  isHorizontal: boolean,\n) =\u003e VirtualItemSizeStatic\n```\nDynamic size is useful when you want your\ngrid items to fill all available space\n```tsx\n// One possible example\nconst calculateItemSize = (crossAxisSize: number) =\u003e {\n  // Choose minimum size depending on the available space.\n  const minWidth = crossAxisSize \u003e 560 ? 180 : 140\n\n  const count = Math.floor(crossAxisSize / minWidth)\n  const width = Math.floor(crossAxisSize / count)\n\n  return {\n    width,\n    height: width + 48\n  }\n}\n\n\u003cVirtualContent itemSize={calculateItemSize}\u003e\u003c/VirtualContent\u003e\n```\n\n## Limitations\nDifferent individual item sizes and scrolling with both directions at the same time are not and likely will never be supported by this package.\n\nPage CSP must allow inline style sheets.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminht11%2Fsolid-virtual-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminht11%2Fsolid-virtual-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminht11%2Fsolid-virtual-container/lists"}