# Getting Started with DataSource

This guide explains how to get started with the KendoReact DataSource hooks. You will learn how to install and use them for managing data operations in your React applications.

<CtaPanelOverview></CtaPanelOverview>

After completing this guide, you will have a React Grid running with the [`useDataSource`](https://www.telerik.com/kendo-react-ui/components/datatools/datasource) hook.

[Demo Source](https://demos.telerik.com/kendo-react-ui/datatools/datasource/get-started/source.txt)

## Before You Begin

To follow the steps in this guide, you need to have a React project set up. If you don't have one, you can create a new React application using Vite by running the following command in your terminal:

```sh
npm create vite@latest my-app -- --template react-ts
```

This guide requires that you have **basic knowledge of React and TypeScript**, and that you have already created [**a blank React project**](https://www.telerik.com/kendo-react-ui/components/getting-started).

> tip You can speed up the development of your KendoReact application with the [Kendo UI Template Wizard for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=KendoUI.kendotemplatewizard).

## Install the package

To install the Data Tools package, run the following command in the root folder of your React project:

```sh
npm i @progress/kendo-react-data-tools
```

## Import the Hooks

After installing the Data Tools package, import the desired hooks in the React App. This guide shows how to add the [DataSource](https://www.telerik.com/kendo-react-ui/components/datatools/datasource).

Place the `import` statements in the App component file (for example: `src/App.tsx`) for your project. Note that the steps for installing and importing all data tools are identical.

```tsx
import { useDataSource } from '@progress/kendo-react-data-tools';
```

## Use the Component

Below you can see how to configure the DataSource via the `useDataSource` hook.

```jsx
const dataState = {
    skip: 0,
    take: 10,
    sort: [{ field: 'ProductName', dir: 'asc' }],
    filter: {
        logic: 'and',
        filters: [{ field: 'UnitPrice', operator: 'gt', value: 20 }]
    }
};

const result = useDataSource({
    data: products,
    dataState
});
```

### Working with Remote Data

For remote data operations, use the `useRemoteDataSource` hook:

```jsx
import { useRemoteDataSource } from '@progress/kendo-react-data-tools';

const result = useRemoteDataSource({
    transport: {
        read: {
            url: 'https://api.example.com/products'
        }
    }
});
```

### Working with OData

For OData services, use the `useODataDataSource` hook which automatically handles OData protocol specifics:

```jsx
import { useODataDataSource } from '@progress/kendo-react-data-tools';

const result = useODataDataSource({
    transport: {
        read: {
            url: 'https://services.odata.org/V4/Northwind/Northwind.svc/Products'
        }
    }
});
```

## Next Steps

Now try to add another component from the Data tools package yourself. The procedures for [installing](https://www.telerik.com/kendo-react-ui/components/datatools/datasource/get-started#install-the-package), [importing](https://www.telerik.com/kendo-react-ui/components/datatools/datasource/get-started#import-the-hooks), and [using](https://www.telerik.com/kendo-react-ui/components/datatools/datasource/get-started#use-the-component) the data tools components are identical for all components in the package.

The Data Tools package provides the following components:

* [Filter](https://www.telerik.com/kendo-react-ui/components/datatools/filter) (premium)
* [Pager](https://www.telerik.com/kendo-react-ui/components/datatools/pager)

# KendoReact Inputs APIs

[Data Tools API](https://www.telerik.com/kendo-react-ui/components/datatools/api)

## Suggested Links

* [DataSource Overview](https://www.telerik.com/kendo-react-ui/components/datatools/datasource)
* [API Reference of the DataTools](https://www.telerik.com/kendo-react-ui/components/datatools/api)
* [Remote Data Operations](https://www.telerik.com/kendo-react-ui/components/datatools/datasource/data-operations/remote-data)
* [OData Integration](https://www.telerik.com/kendo-react-ui/components/datatools/datasource/data-operations/remote-data)
