# Slots Overview

The KendoReact [Scheduler](https://www.telerik.com/kendo-react-ui-develop/components/scheduler) component renders slot as the background of the currently selected view.

## Slot Composition

Analogically to the [Item Compositions](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/customization/items#item-composition), the slots inside the Scheduler follow the same methodology of Composition of multiple React components in order to split the functionalities by logic.

The `Slots` are composed from multiple React Components, with the main three being:

* [SchedulerSlot](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/customization/slots/slot) - Responsible for the `visual` aspect of the slot.
* [SchedulerViewSlot](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/customization/slots/view-slot) - Responsible for side effects like `expansion`.
* [SchedulerEditSlot](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/customization/slots/edit-slot) - Responsible for the `data-editing` functionality.

From now on, we will refer to the composition tree as a `Slot`.

The `Slot` is also rendering additional components like \[SchedulerForm] which can also be customized.

The final tree rendered for a single `Slot` looks like this:

```jsx

<SchedulerEditSlot>
    
    <SchedulerViewSlot>
        
        <SchedulerSlot />
    </SchedulerViewSlot>
    
    <SchedulerForm />
</SchedulerEditSlot>
```

## Importing the Default Slots

The default `slot`, `viewSlot` and `editSlot` are contained in the `@progress/kendo-react-scheduler` package:

```jsx
    // ES2015 module syntax
    import { SchedulerSlot, SchedulerViewSlot, SchedulerEditSlot } from '@progress/kendo-react-scheduler';
```

```jsx
    // CommonJS format
const { SchedulerSlot, SchedulerViewSlot, SchedulerEditSlot } = require('@progress/kendo-react-scheduler');
```

## Providing Custom Slot

To customize a specific part of the `Slot` tree, provide the corresponding [slot](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/api/schedulerprops#slot), [viewSlot](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/api/schedulerprops#viewslot) or [editSlot](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/api/schedulerprops#editslot), or scope the customization by setting the corresponding property to a single [view](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/views).

### Customizing all Slots

For example, if you want to modify the visual part of all slots inside the [Scheduler](https://www.telerik.com/kendo-react-ui-develop/components/scheduler), set the [slot](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/api/schedulerprops#slot) property. But first, let's define our `CustomSlot`.

```jsx
const CustomSlot = (props) => (
    <SchedulerSlot
        {...props}
        style={{
            ...props.style,
            backgroundColor:
                !props.isAllDay && props.start.getHours() === 12
                    ? '#D33F001F'
                    : undefined
        }}
    />
)
```

Now lets tell the `Scheduler` to use our component instead of the default one.

```jsx
<Scheduler slot={CustomSlot}>
    <WeekView />
    <MonthView />
</Scheduler>
```

Pass some dummy data and see our custom slots in action. The following example highlights the slots of the lunch hour inside the `Scheduler`.

[Demo Source](https://demos.telerik.com/kendo-react-ui/scheduler/slots/overview/func/source.txt)

## View Scoped Customization

To scope the custom slot to a specific view only, simply pass the `slot` property to the view. Taking the example from above, if we want to apply the customization only to the week view, simply move the `slot={CustomSlot}` from the `Scheduler` to the `WeekView`;

```jsx
<Scheduler >
    <WeekView slot={CustomSlot} />
    <MonthView />
</Scheduler>
```

## Other Types of Customization

We will take a deeper look at how every custom component can be customized in the following articles:

* [Custom `slot` component](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/customization/slots/slot) - Change the `Slot` visually
* [Custom `viewSlot` component](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/customization/slots/view-slot) - Change the `Slot` in the context of a view.
* [Custom `editSlot` component](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/customization/slots/edit-slot) - Extend the `Slot` data-editing functionality.

## Suggested Links

* [API Reference of the Scheduler](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/api/scheduler)
* [API Reference of the SchedulerSlot](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/api/schedulerslot)
* [API Reference of the SchedulerViewSlot](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/api/schedulerviewslot)
* [API Reference of the SchedulerEditSlot](https://www.telerik.com/kendo-react-ui-develop/components/scheduler/api/schedulereditslot)
* [KendoReact Scheduler](https://www.telerik.com/kendo-react-ui/components/scheduler/)
