# Responsive, Adaptive and Elastic Capabilities

This article explains the **responsive design capabilities RadSlider offers**. The [Lightweight RenderMode](https://www.telerik.com/products/aspnet-ajax/documentation/controls/slider/mobile-support/render-modes) of **RadSlider** supports **responsive design since Q2 2014** and **fluid design since Q3 2014**.

Generally, responsive design means that the page and its content are able to adapt to different screen resolutions without deteriorating the user experience. This often includes  changing the font size  and having  dimensions set in percent.

## Elastic Design with RadSlider

The **Lightweight RenderMode** of the slider supports changing the font size without breaking the control's appearance - if the new size is larger than the original, the elements in the control will simply increase their size as well to accommodate the text. This fluid layout is achieved by using em units for setting dimensions and paddings in the control, instead of px because em units are tied to the font size.This allows dimensions and sizes to scale with the font size.

> note As of 2016 Q1 SP1 **RadSlider** takes the [font-size](https://www.telerik.com/products/aspnet-ajax/documentation/styling/controlling-visual-appearance/fonts) of the page automatically. If the developer does not set it explicitly (**Example 1**), this is up to the client's browser and a common default value is 16px.

> caption **Example 1**: Setting default font for the page with the default value for the Telerik controls.

```CSS
body {
	font-size: 20px;
	font-family: "Segoe UI", Arial, Sans-serif;
}
```

The following sample shows how to increase the font size of a slider and the effect can be seen in comparison in **Figure 1**.

> caption Figure 1: Comparison between appearance of a slider with regular font size and with increased font size.

![Font size comparison](https://www.telerik.com/products/aspnet-ajax/documentation/assets/f083f274cb346cfba661fb861b0c3ed5/slider-font-size-comparison.png)

> caption Example 2: Slider with increased font size to 18px.

```ASP.NET
<style type="text/css">
	div.RadSlider {
		font-size: 18px;
	}
</style>
<telerik:RadSlider ID="RadSlider1" runat="server" RenderMode="Lightweight" Width="400px" Height="100px"
	ItemType="Tick" SmallChange="5" LargeChange="10">
</telerik:RadSlider>
```

## Fluid Design with RadSlider

**RadSlider** supports setting its **Width** property in percentage only when Lightweight render mode is enabled as of the Q3 2014 release of UI for ASP.NET AJAX.This means that the slider changes its width according to the current screen resolution when you set its **Width** property in percentage as shown in **Example 2**. The actual width of the slider is calculated from its parent element, so if you place the slider from **Example 2** in an HTML div element that is 300px wide, the width of the slider should also be 300px.

> caption Example 1: Slider with 100% width.

```ASP.NET
<telerik:RadSlider ID="RadSlider1" runat="server" Width="100%" RenderMode="Lightweight">
</telerik:RadSlider>
```

There are controls and elements that allow you to resize them by dragging their borders, such as the **RadDock** and **RadWindow** Telerik controls, or HTML elements with drag resizing, enabled via client scripts. If you place a fluid slider in such a container, you need to get the client-side object of the slider and call its **repaint()** method when you change the size of the container. **Example 2** shows how to achieve this when you have placed a slider in a **RadDock** control.

> tip If you place a slider in a **RadSplitter** control, you will not have to call its **repaint()** method, because the splitter does this automatically.

> caption Example 2: Slider with 100% width in a resizable RadDock.

```ASP.NET
<script type="text/javascript">
	var slider = null;
	function OnSliderLoad(sender, eventArgs) {
		slider = sender;
	}

	function OnDockResizeEnd(sender, eventArgs) {
		if (slider != null) slider.repaint();
	}
</script>
<telerik:RadDock runat="server" ID="RadDock1" Resizable="true" OnClientResizeEnd="OnDockResizeEnd">
	<ContentTemplate>
		<telerik:RadSlider ID="RadSlider1" runat="server" Width="100%" RenderMode="Lightweight" OnClientLoad="OnSliderLoad">
		</telerik:RadSlider>
	</ContentTemplate>
</telerik:RadDock>
```

## See Also

* [RadSlider Render Modes](https://www.telerik.com/products/aspnet-ajax/documentation/controls/slider/mobile-support/render-modes)

* [RadSlider Client Object](https://www.telerik.com/products/aspnet-ajax/documentation/controls/slider/client-side-programming/radslider-object)

* [Responsive, Adaptive and Elastic Capabilities](https://www.telerik.com/products/aspnet-ajax/documentation/mobile-support/responsive-behaviors)

* [RadWindow Overview](https://www.telerik.com/products/aspnet-ajax/documentation/controls/window/overview)

* [RadSplitter Overview](https://www.telerik.com/products/aspnet-ajax/documentation/controls/splitter/overview)

* [Fonts](https://www.telerik.com/products/aspnet-ajax/documentation/styling/controlling-visual-appearance/fonts)

* [Visual and Dimension Improvements in UI for ASP.NET AJAX](http://www.telerik.com/blogs/visual-and-dimension-improvements-in-ui-for-asp.net-ajax)
