{"id":19357092,"url":"https://github.com/activewidgets/svelte","last_synced_at":"2025-04-23T10:33:11.674Z","repository":{"id":43866021,"uuid":"241714014","full_name":"activewidgets/svelte","owner":"activewidgets","description":"Virtualized Svelte Data Grid","archived":false,"fork":false,"pushed_at":"2023-04-30T18:49:22.000Z","size":1310,"stargazers_count":13,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-17T03:40:26.662Z","etag":null,"topics":["data-grid","data-table","datagrid","datatable","grid","scrolling","svelte","table","virtual","virtualized"],"latest_commit_sha":null,"homepage":"https://activewidgets.com/svelte/data-grid/","language":"JavaScript","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/activewidgets.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2020-02-19T20:04:43.000Z","updated_at":"2024-04-01T08:19:57.000Z","dependencies_parsed_at":"2022-09-05T03:41:20.604Z","dependency_job_id":null,"html_url":"https://github.com/activewidgets/svelte","commit_stats":{"total_commits":82,"total_committers":1,"mean_commits":82.0,"dds":0.0,"last_synced_commit":"babfd00863526775a14228e8a925f82ecbc117d5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activewidgets%2Fsvelte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activewidgets%2Fsvelte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activewidgets%2Fsvelte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activewidgets%2Fsvelte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/activewidgets","download_url":"https://codeload.github.com/activewidgets/svelte/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250416978,"owners_count":21427106,"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","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":["data-grid","data-table","datagrid","datatable","grid","scrolling","svelte","table","virtual","virtualized"],"created_at":"2024-11-10T07:06:18.581Z","updated_at":"2025-04-23T10:33:06.659Z","avatar_url":"https://github.com/activewidgets.png","language":"JavaScript","readme":"### \n\n# ActiveWidgets/Svelte • Datagrid \n\n[![npm version](https://img.shields.io/npm/v/@activewidgets/svelte)](https://www.npmjs.com/package/@activewidgets/svelte \"View this project on npm\")\n[![npm downloads](https://img.shields.io/npm/dm/@activewidgets/svelte)](https://www.npmjs.com/package/@activewidgets/svelte \"npm package downloads/month\")\n[![Github issues](https://img.shields.io/github/issues/activewidgets/svelte)](https://github.com/activewidgets/svelte/issues \"See Github issues\")\n[![Github repo](https://img.shields.io/github/stars/activewidgets/svelte?label=GitHub\u0026style=social)](https://github.com/activewidgets/svelte \"Open Github repo\")\n\nActiveWidgets is a multi-framework UI component library. This package provides [virtualized datagrid component for Svelte](https://activewidgets.com/svelte/data-grid/).\n\n[Live demo](https://svelte.activewidgets.com) / [Developer guide](https://activewidgets.com/guide/) / [API reference](https://activewidgets.com/api/)\n\n[![Datagrid demo](https://cdn.activewidgets.com/assets/screens/demo.png)](https://svelte.activewidgets.com)\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Data properties](#data-properties)\n- [User events](#user-events)\n\n## Installation\n\nAdd [@activewidgets/svelte](/api/packages/svelte/) to your project dependencies -\n\n```sh\n\u003e npm i --save @activewidgets/svelte\n```\n\n## Usage\n\nNow you can import ActiveWidgets component classes -\n\n```js\nimport { Datagrid } from \"@activewidgets/svelte\";\n```\n\nand use them like any standard Svelte component.\n\n```html\n\u003cscript\u003e\n\nimport { Datagrid } from '@activewidgets/svelte';\nimport './styles.css';\n\nlet rows = [\n    { message: 'Hello, World!' }\n];\n\n\u003c/script\u003e\n\n\u003cDatagrid {rows} /\u003e\n```\n[Live example](https://svelte.activewidgets.com/examples/svelte/hello-world/) | [Source on github](https://github.com/activewidgets/svelte/tree/master/examples/hello-world) | [Edit on stackblitz](https://stackblitz.com/github/activewidgets/svelte/tree/master/examples/hello-world?file=src/app.svelte)\n\n\n## Data properties\n\nYou have to provide [columns](/api/datagrid/columns/) and [rows](/api/datagrid/rows/) properties to the datagrid to show some data. The properties of each `column` object define how the data will be rendered -\n\n- [field](/api/datagrid/columns/#field) - where the cell data comes from (string|function)\n- [header](/api/datagrid/columns/#header) - column header (string|object)\n- [width](/api/datagrid/columns/#width) - column width (number, in pixels)\n- [align](/api/datagrid/columns/#align) - cell text alignment (left|right|center)\n- [format](/api/datagrid/columns/#format) - number/date format (string|function)\n- [fixed](/api/datagrid/columns/#fixed) - fixed (true/false) for columns on the left or right side\n\nThe `style` (string|object) or `className` properties allow to change the styling of the column and cell elements.\n\n```html\n\u003cscript\u003e\n// ...\n\nconst columns = [\n  {header: 'Code', field: 'customerID', width: 80, style: 'background:#def', fixed: true},\n  {header: 'Company Name', field: 'companyName', width: 160},\n  {header: 'Contact', field: 'contactName', width: 120},\n  {header: 'Title', field: 'contactTitle', width: 120},\n  {header: 'Address', field: 'address', width: 120, align: 'right'}\n];\n\nconst rows = northwind.customers;\n\n\u003c/script\u003e\n\n\u003cDatagrid {columns} {rows} /\u003e\n```\n[Live example](https://svelte.activewidgets.com/examples/svelte/columns/) | [Source on github](https://github.com/activewidgets/svelte/tree/master/examples/columns) | [Edit on stackblitz](https://stackblitz.com/github/activewidgets/svelte/tree/master/examples/columns?file=src/app.svelte)\n\n\n## User events\n\nIn addition to the standard DOM keyboard and mouse events the datagrid emits composite \n[mouse](/api/datagrid/mouse-event/) event which makes it easier to find the elements affected by the user action -\n\n```html\n\u003cscript\u003e\n// ...\n\nfunction onMouse({row}){\n    alert(`row ${row.key} clicked!`);\n}\n\n\u003c/script\u003e\n\n\u003cDatagrid {columns} {rows} on:mouse={e =\u003e onMouse(e.detail)} /\u003e\n```\n[Live example](https://svelte.activewidgets.com/examples/svelte/events/) | [Source on github](https://github.com/activewidgets/svelte/tree/master/examples/events) | [Edit on stackblitz](https://stackblitz.com/github/activewidgets/svelte/tree/master/examples/events?file=src/app.svelte)\n\n## More info\n\n- [Live demo](https://svelte.activewidgets.com) \n- [Developer guide](https://activewidgets.com/guide/) \n- [API reference](https://activewidgets.com/api/)\n- [Licensing](https://activewidgets.com/licenses/)\n- [Support forum](https://activewidgets.com/messages/)\n\n\n---\n\n[![ActiveWidgets](https://activewidgets.com/include/logo/aw-logo-40.png)](https://activewidgets.com) \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivewidgets%2Fsvelte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factivewidgets%2Fsvelte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivewidgets%2Fsvelte/lists"}