Stepper
The Stepper component lets the user adjust a value by increasing and decreasing it in small steps. Steppers are used in situations where a user needs to adjust a value by a small amount.
Usage
Use the label
option to provide a label to the stepper.
<mbsc-stepper label="Label"></mbsc-stepper>
Value binding
The stepper can be bound to a number value using either the [(ngModel)]
or the formControlName
directives. In this case the stepper will update it's state according to the bound the value.
<mbsc-stepper label="My Age" [(ngModel)]="myAge"></mbsc-stepper>
@Component({...})
export class MyComponent {
myAge = 24;
}
Options
Explore the following API options that help you easily configure the Stepper component.
color
"success" | "light" | "dark" | "primary" | "secondary" | "danger" | "warning" | "info"
Specifies the predefined color of the stepper.
Default value: undefined
cssClass
string
Specifies a custom CSS class for the component.
Default value: undefined
description
string
Specifies the description text of the stepper.
Default value: undefined
disabled
boolean
Specifies the disabled state of the stepper.
Default value: false
inputPosition
"center" | "end" | "start"
Specifies the input field position compared to the +/- stepper buttons.
Default value: 'center'
label
string
Specifies the label of the stepper.
Default value: undefined
max
number
Specifies the minimum value that can be selected.
Default value: 0
min
number
Specifies the maximum value that can be selected.
Default value: 100
step
number
Specifies the step between values.
Default value: 1
theme
string
Specifies the visual appearance of the component.
If it is 'auto'
or undefined
, the theme will automatically be chosen based on the platform.
If custom themes are also present, they will take precedence over the built in themes, e.g. if there's an iOS based custom theme,
it will be chosen on the iOS platform instead of the default iOS theme.
Supplied themes:
'ios'
- iOS theme'material'
- Material theme'windows'
- Windows theme
It's possible to modify theme colors or create custom themes.
Make sure that the theme you set is included in the downloaded package.
Default value: undefined
themeVariant
"auto" | "light" | "dark"
Controls which variant of the theme will be used (light or dark).
Possible values:
'light'
- Use the light variant of the theme.'dark'
- Use the dark variant of the theme.'auto'
orundefined
- Detect the preferred system theme on devices where this is supported.
To use the option with custom themes, make sure to create two custom themes, where the dark version has the same name as the light one,
suffixed with '-dark'
, e.g.: 'my-theme'
and 'my-theme-dark'
.
Default value: undefined
Events
The Stepper component ships with different event hooks for deep customization. Events are triggered through the lifecycle of the component where you can tie in custom functionality and code.
onDestroy
(args: any, inst: any) => void
Triggered when the component is destroyed.
Parameters:
args - The event argument object.
inst - The component instance.
onInit
(args: any, inst: any) => void
Triggered when the component is initialized.
Parameters:
args - The event argument object.
inst - The component instance.
Localization
The Stepper component is fully localized. This covers date and time format, button copy, rtl and more.
locale
string | MbscLocale
Sets the language of the component. The locale object contains all the translations for a given language. The built in language modules are listed below. If a language is not listed, it can be provided as a custom language module.
Supported values:
- Arabic:
localeAr
,'ar'
- Bulgarian:
localeBg
,'bg'
- Catalan:
localeCa
,'ca'
- Czech:
localeCs
,'cs'
- Chinese:
localeZh
,'zh'
- Croatian:
localeHr
,'hr'
- Danish:
localeDa
,'da'
- Dutch:
localeNl
,'nl'
- English:
localeEn
orundefined
,'en'
- English (UK):
localeEnGB
,'en-GB'
- Farsi:
localeFa
,'fa'
- German:
localeDe
,'de'
- Greek:
localeEl
,'el'
- Spanish:
localeEs
,'es'
- Finnish:
localeFi
,'fi'
- French:
localeFr
,'fr'
- Hebrew:
localeHe
,'he'
- Hindi:
localeHi
,'hi'
- Hungarian:
localeHu
,'hu'
- Italian:
localeIt
,'it'
- Japanese:
localeJa
,'ja'
- Korean:
localeKo
,'ko'
- Lithuanian:
localeLt
,'lt'
- Norwegian:
localeNo
,'no'
- Polish:
localePl
,'pl'
- Portuguese (Brazilian):
localePtBR
,'pt-BR'
- Portuguese (European):
localePtPT
,'pt-PT'
- Romanian:
localeRo
,'ro'
- Russian:
localeRu
,'ru'
- Russian (UA):
localeRuUA
,'ru-UA'
- Slovak:
localeSk
,'sk'
- Serbian:
localeSr
,'sr'
- Swedish:
localeSv
,'sv'
- Thai:
localeTh
,'th'
- Turkish:
localeTr
,'tr'
- Ukrainian:
localeUa
,'ua'
Default value: undefined
rtl
boolean
Enables right-to-left display.
Default value: false
Types
MbscLocale
Interface
Properties:
allDayText
: stringamText
: stringcalendarSystem
: MbscCalendarSystemcancelText
: stringclearText
: stringcloseText
: stringdateFormat
: stringdateFormatFull
: stringdateFormatLong
: stringdateText
: stringdateWheelFormat
: stringdayNames
: Array<string>dayNamesMin
: Array<string>dayNamesShort
: Array<string>daySuffix
: stringdayText
: stringeventText
: stringeventsText
: stringfilterEmptyText
: stringfilterPlaceholderText
: stringfirstDay
: numberfromText
: stringhourText
: stringminuteText
: stringmonthNames
: Array<string>monthNamesShort
: Array<string>monthSuffix
: stringmonthText
: stringmoreEventsPluralText
: stringmoreEventsText
: stringnextMonthText
: stringnextYearText
: stringnoEventsText
: stringnowText
: stringpmText
: stringprevMonthText
: stringprevYearText
: stringrangeEndHelp
: stringrangeEndLabel
: stringrangeStartHelp
: stringrangeStartLabel
: stringrtl
: booleansecondText
: stringselectedPluralText
: stringselectedText
: stringsetText
: stringtimeFormat
: stringtimeText
: stringtimeWheels
: stringtoText
: stringtodayText
: stringweekText
: stringyearSuffix
: stringyearText
: string