# Slider class

Namespace: [Grasshopper2.UI.Slider](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.ui.slider.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class Slider : IResponsive, IBundleAware
```

Standard slider UX object.

## Constructors

- [Slider](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/ctor.md): (3 overloads) Create a default slider from zero to one.

## Properties

- [BackColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/backcolour.md): Gets the sets the colour of the slider background. This will also affect the colour of the border, if any.
- [Bounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/bounds.md): Gets or sets the layout bounds for this slider.
- [Bundle](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/bundle.md): Gets the bundle this slider is associated with.
- [BundledSliders](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/bundledsliders.md): Enumerate over all *other* sliders in the same bundle as this one.
- [CornerRadius](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/cornerradius.md): Gets the corner radii of the grip. This depends solely on the grip type.
- [CustomFormatting](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/customformatting.md): Gets or sets a custom formatting delegate.
- [Font](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/font.md): Gets or sets the value format for the slider grip.
- [Format](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/format.md): Gets or sets the value format for the slider grip. The format supports several placeholders: {0} will be replaced with the standard formatting. {1} will be replaced with the standard percentile formatting. {2} will be replaced with the actual value, and as such supports custom formatting hints. {3} will be replaced with the normalised value, and as such supports custom formatting hints. {4} will be replaced with the percentage value, and as such supports custom formatting hints. {5} will be replaced with the non-linear value. {6} will be replaced with the custom formatting string.
- [GripColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/gripcolour.md): Gets the sets the colour of the slider grip.
- [GripDisplay](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/gripdisplay.md): Gets or sets the grip display type.
- [Icon](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/icon.md): Gets the icon (if any) associated with this slider.
- [IconKey](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/iconkey.md): Gets the icon state key associated with the slider value.
- [Limits](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/limits.md): Gets the limits and average value of this slider. Note, for the true values, access the Value property.
- [NonLinearity](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/nonlinearity.md): Gets the non-linearity of this slider.
- [PresetCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/presetcount.md): Gets the number of defined presets.
- [PresetNames](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/presetnames.md): Enumerate over all preset names.
- [PresetRestrict](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/presetrestrict.md): Gets or sets whether the slider is only allowed to exist at preset values.
- [PresetValues](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/presetvalues.md): Enumerate over all preset values.
- [RailDisplay](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/raildisplay.md): Gets or sets the rail display type.
- [Responder](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/responder.md): Gets the UI response logic.
- [SlabThickness](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/slabthickness.md): Gets or sets the thickness of the grip. When left at its default ([float.NaN](https://learn.microsoft.com/dotnet/api/system.single.nan)) the value is derived from the grip type via `SliderLayout.GripThickness` / `SliderLayout.LabelThickness`. Callers that want the slab thickness to match a surrounding canvas shape can assign that thickness here prior to drawing.
- [Values](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/values.md): Gets the value plurality for this slider.

## Methods

- [AddPreset](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/addpreset.md): (2 overloads) Add a preset by name and value.
- [Draw](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/draw.md): Render this slider into a context.
- [FormatValue](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/formatvalue.md): format a given value using the Format field. This is the text that the slider displays on the grip.
- [IsPreset](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/ispreset.md): (2 overloads) Gets whether a preset value has already been defined.
- [NearestPreset](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/nearestpreset.md): (2 overloads) Find the nearest preset.
- [NextPreset](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/nextpreset.md): (2 overloads) Find the first preset strictly larger than the locus.
- [PerformLayout](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/performlayout.md): Perform layout for the current slider state.
- [PreviousPreset](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/previouspreset.md): (2 overloads) Find the first preset strictly smaller than the locus.
- [RemovePreset](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/removepreset.md): (2 overloads) Remove a preset by value.
- [RenderCustom](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/rendercustom.md): Render this slider into a graphics context, with optional overrides for various layers.
- [RenderStandardBack](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/renderstandardback.md): (static) Default background render method.
- [RenderStandardGrip](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/renderstandardgrip.md): (static) Default grip render method.
- [RenderStandardPopup](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/renderstandardpopup.md): (static) Default numeric popup render method.
- [RenderStandardRail](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/renderstandardrail.md): (static) Default rail render method.
- [RenderStandardText](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/renderstandardtext.md): (static) Default rail render method.
- [SetLimits](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/setlimits.md): Set new limits and value of this slider.
- [SnapToPreset](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/snaptopreset.md): Snap a value to the nearest preset in range.

## Events

- [SliderDisplayChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/sliderdisplaychanged.md): This event is raised whenever the slider state, but not the value changes.
- [SliderValueChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.slider.slider/slidervaluechanged.md): This event is raised whenever the slider value changes.
