Movatterモバイル変換


[0]ホーム

URL:


CoreUI Angular Logo
Framework:
Getting startedIntroductionSupport CoreUICustomizeSassOptionsCSS VariablesLayoutBreakpointsContainersGridColumnsGuttersFormsOverviewAutocompletePRODate PickerPRODate Range PickerPROForm ControlSelectMulti SelectPROChecks & RadiosPassword InputPRORangeRange SliderPRORatingPROStepperPROInput GroupFloating LabelsLayoutTime PickerPROValidationComponentsAccordionAlertAvatarBadgeBreadcrumbButtonButton GroupCalendarPROCalloutCardCarouselClose buttonCollapseDropdownFooterHeaderImageList GroupLoading ButtonPROModalNavNavbarOffcanvasPaginationPlaceholderPopoverProgressSmart PaginationPROSmart TablePROSidebarSpinnerTableTabsNewToastTooltipWidgetsIconsChartsTemplatesNewAdmin & DashboardDownloadInstallationCustomizeContentMigrationv4 → v5v3 → v4Angular version


DownloadHire UsGet CoreUI PRO
On this page
CoreUI PRO for Angular This component is part of CoreUI PRO – a powerful UI library with over 250 components and 25+ templates, designed to help you build modern, responsive apps faster. Fully compatible with Angular, Bootstrap, React.js, and Vue.js. Get CoreUI PRO

Angular Range Slider

Enhance your forms with our customizable Angular Range Slider component for advanced range selection.

Introduced inPro v5.3.5+

Overview

The Angular Range Slider component allows users to select a value or range of values within a predefined range. Unlike the standard<input type="range">, the Range Slider offers enhanced customization options, including multiple handles, labels, tooltips, and vertical orientation. It ensures consistent styling across browsers and provides a rich set of features for advanced use cases.

Low
Medium
High
Loading...

Features

  • Multiple Handles: Select single or multiple values within the range.
  • Custom Labels: Display labels at specific points on the slider.
  • Tooltips: Show dynamic tooltips displaying current values.
  • Vertical Orientation: Rotate the slider for vertical layouts.
  • Clickable Labels: Enable users to click on labels to set slider values.
  • Disabled State: Disable the slider to prevent user interaction.

Angular Range Slider Example

Create a simple range slider with default settings.

Loading...

Multiple handles

Enable multiple handles to allow the selection of a range or/and multiple values.

Loading...

Vertical Range Slider

Rotate the slider to a vertical orientation.

Loading...

Disabled

Disable the slider to prevent user interaction.

Loading...

Min and max

Angular Range Slider component has implicit values formin andmax0 and100, respectively. You may specify new values for those using themin andmax attributes.

Loading...

Steps

Range Slider inputs automatically "snap" to whole numbers. To modify this behavior, set astep value.In the example below:

  • we increase the number of steps by specifyingstep="0.25"
  • we decrease the number of steps by specifyingstep="5"
Loading...

Distance

Sets the minimum distance between multiple slider handles by settingdistance and ensures that the handles do not overlap or get too close.

Loading...

Labels

Add labels to specific points on the slider for better context. If you provide an array of strings, as in the example below, then labels will be spaced at equal distances from the beginning to the end of the slider.

Start
Middle
End
Loading...

Labels customization

Labels can be configured as an array of strings or objects. When using objects, you can specify additional properties likevalue,label,class, andstyle.

-50°C
0°C
20°C
100°C
Loading...
Loading...

Clickable labels

By default, users can click on labels to set the slider to specific values. You can disable this feature by settingclickableLabels tofalse.

Low
Medium
High
Loading...

Tooltips

By default, tooltips display the current value of each handle. You can disable tooltips by settingtooltips tofalse.

Loading...

Tooltips formatting

Customize the content of tooltips using thetooltipsFormat property. This should be a function that formats the tooltip text based on the current value.

$0
$250
$500
$1000
Loading...
Loading...

Track

Thetrack property allows you to customize how the slider's track is displayed. By default, thetrack property is set tofill enabling dynamic filling of the track based on the slider's current value(s). This means the filled portion of the track will adjust automatically as the slider handle move, offering a responsive visual representation of the selected range.

Disable filling

If you settrack tofalse, the slider's track will not display any fill. Only the default track background will be visible, which can be useful for minimalist designs or when you use more then two handles.

Loading...

Forms

Angular handles user input through reactive and template-driven forms. CoreUI Range Slider supports both approaches.

Reactive

The Angular Range Slider component can be used in reactive forms. You can bind the slider's value to a form control using theformControlName directive.


Form value: { "rangeSlider": [ 50, 75 ], "singleSlider": 60}
Loading...
Loading...

Template-driven

The Angular Range Slider component can be used in template-driven forms. You can bind the slider's value to a template variable using thengModel directive.


Form value: { "rangeSlider": [ 40, 75 ], "singleSlider": 60}
Loading...
Loading...

Accessibility

The Angular Range Slider component is built with accessibility in mind. Each slider handle includes the following ARIA attributes:

  • role:slider
  • aria-valuemin: Minimum value
  • aria-valuemax: Maximum value
  • aria-valuenow: Current value
  • aria-orientation:horizontal orvertical

Additionally, ensure that labels and tooltips are clear and descriptive to provide the best experience for all users.

Customizing

CSS variables

Angular CoreUI Range Sliders use local CSS variables on.range-slider class for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.

How to use CSS variables

Loading...

SASS variables


API reference

Range Slider Module

Range Slider Standalone

c-range-slider

component


Inputs
namedescriptiontypedefault
clickableLabelsEnable or disable clickable labels in the Angular Range Slider. When set to true, users can click on labels to adjust the slider's value directly, enhancing interactivity and user experience.booleantrue
disabledToggle thedisabled state for the component.booleanfalse
distanceDefine the minimum distance between slider handles using the distance prop in the Angular Range Slider. This ensures that the handles maintain a specified separation, preventing overlap and maintaining clear value distinctions.number0
labelsAdd descriptive labels to your Angular Range Slider by providing an array of labels. These labels enhance the slider's usability by clearly indicating key values and providing contextual information to users.Label[]undefined
maxSpecify the maximum value for the Angular Range Slider with themax prop. This determines the upper limit of the slider's range, enabling precise control over the highest selectable value.number100
minSet the minimum value for the Angular Range Slider using the min prop. This defines the lower bound of the slider's range, allowing you to control the starting point of user selection.number0
stepControl the granularity of the Angular Range Slider by setting thestep prop. This defines the increment intervals between selectable values, allowing for precise adjustments based on your application's requirements.number1
tooltipsEnabletooltips with default values or set specific labels for each icon.booleantrue
tooltipsFormatCustomize the display format of tooltips in the Angular Range Slider using thetooltipsFormat function. This allows you to format the tooltip values according to your specific requirements, enhancing the clarity and presentation of information.(value: number) => stringundefined
trackControls the visual representation of the slider's track. When set tofill, the track is dynamically filled based on the slider's value(s). Setting it tofalse disables the filled track.boolean |"fill"fill
valueSet the current value(s) of the Angular Range Slider using thevalue prop. Whether you're using a single value or an array for multi-handle sliders, this prop controls the slider's position and ensures it reflects the desired state.number |number[]required
verticalOrient the Angular Range Slider vertically by setting thevertical prop totrue. This changes the slider's layout from horizontal to vertical, providing a different aesthetic and fitting various UI designs.booleanfalse

Outputs
namedescriptiontype
valueChangeEvent emitted onvalue changenumber |number[]

Types

CoreUI for Angular is Open Source UI Components Library for Angular.

Currently v5.5.17 Code licensed MIT, docs CC BY 3.0 .
CoreUI PRO requires acommercial license.


[8]ページ先頭

©2009-2025 Movatter.jp