# Slider

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/struct-slider/

**struct** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
struct Slider
```

A control that lets the user select from a range of values by moving a
thumb control along a track.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L48)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`on_thumb_drag_started`](#function-on_thumb_drag_started)
- [`on_thumb_drag_completed`](#function-on_thumb_drag_completed)
- [`TEMPLATE_PARTS`](#assoc_const-template_parts)
- [`PSEUDO_CLASSES`](#assoc_const-pseudo_classes)
- [`orientation_property`](#function-orientation_property)
- [`is_direction_reversed_property`](#function-is_direction_reversed_property)
- [`is_snap_to_tick_enabled_property`](#function-is_snap_to_tick_enabled_property)
- [`tick_frequency_property`](#function-tick_frequency_property)
- [`tick_placement_property`](#function-tick_placement_property)
- [`ticks_property`](#function-ticks_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`ticks`](#function-ticks)
- [`set_ticks`](#function-set_ticks)
- [`orientation`](#function-orientation)
- [`set_orientation`](#function-set_orientation)
- [`is_direction_reversed`](#function-is_direction_reversed)
- [`set_is_direction_reversed`](#function-set_is_direction_reversed)
- [`is_snap_to_tick_enabled`](#function-is_snap_to_tick_enabled)
- [`set_is_snap_to_tick_enabled`](#function-set_is_snap_to_tick_enabled)
- [`tick_frequency`](#function-tick_frequency)
- [`set_tick_frequency`](#function-set_tick_frequency)
- [`tick_placement`](#function-tick_placement)
- [`set_tick_placement`](#function-set_tick_placement)
- [`is_dragging`](#function-is_dragging)
- [`track`](#function-track)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L63)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<Slider>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L63)

<a id="function-on_thumb_drag_started"></a>

### on_thumb_drag_started

```rust
fn on_thumb_drag_started(self: &Self, e: &VectorEventArgs)
```

Called when the user starts dragging the thumb.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L63)

<a id="function-on_thumb_drag_completed"></a>

### on_thumb_drag_completed

```rust
fn on_thumb_drag_completed(self: &Self, e: &VectorEventArgs)
```

Called when the user stops dragging the thumb.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L63)

<a id="assoc_const-template_parts"></a>

### TEMPLATE_PARTS

```rust
const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
```

The named parts expected in the control template.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L256)

<a id="assoc_const-pseudo_classes"></a>

### PSEUDO_CLASSES

```rust
const PSEUDO_CLASSES: PseudoClassesAttribute
```

The pseudoclasses set by the class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L263)

<a id="function-orientation_property"></a>

### orientation_property

```rust
fn orientation_property() -> &'static StyledProperty<Orientation>
```

Defines the `Orientation` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L267)

<a id="function-is_direction_reversed_property"></a>

### is_direction_reversed_property

```rust
fn is_direction_reversed_property() -> &'static StyledProperty<bool>
```

Defines the `IsDirectionReversed` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L267)

<a id="function-is_snap_to_tick_enabled_property"></a>

### is_snap_to_tick_enabled_property

```rust
fn is_snap_to_tick_enabled_property() -> &'static StyledProperty<bool>
```

Defines the `IsSnapToTickEnabled` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L267)

<a id="function-tick_frequency_property"></a>

### tick_frequency_property

```rust
fn tick_frequency_property() -> &'static StyledProperty<f64>
```

Defines the `TickFrequency` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L267)

<a id="function-tick_placement_property"></a>

### tick_placement_property

```rust
fn tick_placement_property() -> &'static StyledProperty<TickPlacement>
```

Defines the `TickPlacement` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L267)

<a id="function-ticks_property"></a>

### ticks_property

```rust
fn ticks_property() -> &'static StyledProperty<Option<TickList>>
```

Defines the `Ticks` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L267)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L335)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L351)

<a id="function-ticks"></a>

### ticks

```rust
fn ticks(self: &Self) -> Option<TickList>
```

Defines the ticks to be drawn on the tick bar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L356)

<a id="function-set_ticks"></a>

### set_ticks

```rust
fn set_ticks(self: &Self, value: Option<TickList>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L360)

<a id="function-orientation"></a>

### orientation

```rust
fn orientation(self: &Self) -> Orientation
```

The orientation of the slider.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L365)

<a id="function-set_orientation"></a>

### set_orientation

```rust
fn set_orientation(self: &Self, value: Orientation)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L369)

<a id="function-is_direction_reversed"></a>

### is_direction_reversed

```rust
fn is_direction_reversed(self: &Self) -> bool
```

The direction of increasing value.

True if the direction of increasing value is to the left for a
horizontal slider or down for a vertical slider; otherwise, false.
The default is false.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L378)

<a id="function-set_is_direction_reversed"></a>

### set_is_direction_reversed

```rust
fn set_is_direction_reversed(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L382)

<a id="function-is_snap_to_tick_enabled"></a>

### is_snap_to_tick_enabled

```rust
fn is_snap_to_tick_enabled(self: &Self) -> bool
```

Indicates whether the slider automatically moves the thumb to the
closest tick mark.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L388)

<a id="function-set_is_snap_to_tick_enabled"></a>

### set_is_snap_to_tick_enabled

```rust
fn set_is_snap_to_tick_enabled(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L392)

<a id="function-tick_frequency"></a>

### tick_frequency

```rust
fn tick_frequency(self: &Self) -> f64
```

The interval between tick marks.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L397)

<a id="function-set_tick_frequency"></a>

### set_tick_frequency

```rust
fn set_tick_frequency(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L401)

<a id="function-tick_placement"></a>

### tick_placement

```rust
fn tick_placement(self: &Self) -> TickPlacement
```

Indicates where to draw tick marks in relation to the track.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L406)

<a id="function-set_tick_placement"></a>

### set_tick_placement

```rust
fn set_tick_placement(self: &Self, value: TickPlacement)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L410)

<a id="function-is_dragging"></a>

### is_dragging

```rust
fn is_dragging(self: &Self) -> bool
```

Whether the slider is currently being dragged.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L415)

<a id="function-track"></a>

### track

```rust
fn track(self: &Self) -> Option<Ref<Track>>
```

The track part of the slider.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/slider.rs#L420)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`SliderImplExt`](/docs/0.5.0/api/ferroui-controls/trait-sliderimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<Slider>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`SliderImpl`](/docs/0.5.0/api/ferroui-controls/trait-sliderimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
