--- title: "ZingGrid Web Component: `` | Docs" description: "View our in depth tutorial covering the web component `` tag and the associated features for the JavaScript grid." url: https://www.zinggrid.com/docs/v1/api/tags/zg-data --- ```text experiment_id: web-retrieval-v1 fixture_id: /docs/v1/api/tags/zg-data.md mode: provenance representation: markdown origin_response_id: 55a01ca75dd8f701220e7e44bfe5a22f version: 2026-10-21 version_created_at_utc: 2026-10-21T20:42:35.757Z version_nonce: ff8cbe96ee6ef084d356bdd975f2d1b0 generated_at_utc: 2026-11-08T03:04:56.888Z response_nonce: 596ba21c6875b623308f71ea670569a9 ``` # `` Version 1 [Interactive Storybook Playground](https://storybook.zinggrid.com/?path=/docs/zg-data--docs) The `` tag is a web component that controls data associated to the grid. **As an non-visual element, you should not apply style to this tag**. ![Image of the DOM relationship for the zg-data web component tag](https://storage.googleapis.com/zinggrid-pwa.appspot.com/components/zg-data-web-component-dom.png "Image of the DOM relationship for the zg-data web component tag") | Component | Relationship | Type | Ancestor | | --- | --- | --- | --- | | [ZingGrid](https://www.zinggrid.com/docs/api/tags/zing-grid) | Parent | Manual | n/a | | [ZGParam](https://www.zinggrid.com/docs/api/tags/zg-param) | Child | Manual | n/a | #### Related Web Components - [``](https://www.zinggrid.com/docs/api/tags/zing-grid/) - [``](https://www.zinggrid.com/docs/api/tags/zg-param/) - [``](https://www.zinggrid.com/docs/api/tags/zg-load-mask/) - [``](https://www.zinggrid.com/docs/api/tags/zg-no-data/) ## Usage A `` tag will always be implicitly used by the grid; when using top level `data` and `src` tags, a `` is created behind the scenes. ```html ``` The following markup is the same as the HTML above: ```html ``` If you have a more complex use case that requires headers and arguments to be passed to the server containing your `src`, then `` and ``(s) will be used. ``should be employed and various configuration values set via the `options` attribute, or more appropriately, via `` tags nested within the tag. ```html ZingGrid Star Wars Server Paging Reload Demo ``` ## Attributes There are a couple attributes for `` that are used to create adapters, parameters and arguments when fetching your data source. **Example Usage** ```html ``` ### adapter Adapter is a shortcut to set known options for specific third party datasets. Currently supports `graphql` and `firebase`. Developers could register their own custom adapters. For more information on custom adapters, visit Guides > ZingGrid Object > registerAdapter(). - Type: String - Default: `""` - Accepted values: "firebase", "graphql" - Supported versions: 2.x [Example code](https://app.zingsoft.com/demos/embed/36KGT9LR) ### data Data for the grid presented as an array or object. If set as an attribute value, the data needs to be in JSON format. - Type: Object - Default: `""` - Accepted values: [{"firstName": "John", "lastName": "Doe"}] - Supported versions: 2.x [Example code](https://app.zingsoft.com/demos/embed/BXPENKMP) ### id-key In the case of non-key based objects, the idKey can be set to indicate the id to send back to the datasource on CRUD commands. For example, if the READ URL was https://zinggrid-named.firebaseio.com/ then the UPDATE would be https://zinggrid-named.firebaseio.com/VALUE_OF_IDKEY. - Type: String - Default: `"id"` - Accepted values: "state" - Supported versions: 2.x [Example code](https://app.zingsoft.com/demos/embed/NKCF2H81) ### options Used to set ``, the configuration data for ``. This should never be used directly as an attribute and is meant for object instantiation and for setting in JavaScript. - Type: Object - Default: `{}` - Accepted values: {"idKey":"state","sortDirKey":"_order","sortDir":"desc","sortByKey":"_sort","sortBy":"capital","src":"https://zinggrid-named.firebaseio.com/"} - Supported versions: 2.x [Example code](https://app.zingsoft.com/demos/embed/9AODYVJT) ### src Specifies the absolute or relative URL to fetch data from to populate the grid - Type: String - Default: `""` - Accepted values: "https://url-to-your-api" - Supported versions: 2.x [Example code](https://app.zingsoft.com/demos/embed/R2K22X2Q) ## CSS Variables There are no CSS variables available for the `` web component. ## CSS Selector As an non-visual element, you should not apply style to this tag. ## Slots `` contains placeholders to allow adding markup inside the component. ```html ``` Below is a list of all the associated ZGData slots. Check out the [full list of slots](https://www.zinggrid.com/docs/api/styling/css-shadow-parts). | Name | Description | | --- | --- | | (default) | Data content that only accepts data configuration options (ZGParams). |