Spark
v1
  • Spark v3
  • Spark v2
  • Spark v1
  • Design Foundations
    • Animations
    • Color Palette
    • Iconography
    • Layout Guidelines
    • Sabre Logo Guidelines
    • Guiding Principles
    • Spark Themes
    • Typography
    • Voice and Tone
    • View All Foundations
  • UI Components
    • Containers & Navigation
      • Carousel
      • Expand & Collapse
      • Footer
      • Header & Navigation
      • Modals
      • Pagination and View More
      • Panels
      • Panel Menu
      • Responsive Grid
      • Scroll to Top
      • Tables
      • Tabs
      • Toolbar
    • Data Visualization
      • Introduction to Data Visualization
      • Color Palettes for Data Visualization
      • Bar Charts
      • Gauges
      • Line Graphs
      • Pie and Donut Charts
    • Form Elements
      • Buttons
      • Checkboxes
      • Date Selection
      • Multi-Select
      • Number Selector
      • Radio Buttons
      • Select Input
      • Sliders
      • Text Input
      • Toggles and Switches
    • Messaging & Content
      • Links
      • Messages
      • Popovers
      • Progress Indicators
      • Step Indicator
      • Tooltips
    • Page Templates
      • Sign-In Screen
      • Single Container Layout
      • Single Container with Side Menu Layout
      • Splash Screen
      • Tabbed Container Layout
      • Tabbed Container with Side Menu Layout
    • View All Components
  • Resources
    • Designer
      • Application Icons
    • Developer
      • Browser Support
      • Changelog
      • CSS Helper Classes
      • Javascript API Documentation
        • Back to Main Menu
        • Javscript API Documentation
        • Main
        • components/ base.js
          • BaseComponent
          • requestAnimationFrame
          • cancelAnimationFrame
          • breakpoints
          • exportjQuery
          • loadOrCreateJQueryInstance
          • setParams
          • unsetParams
          • toggleClass
          • addClass
          • removeClass
          • hasClass
          • getChildIndex
          • elementHasParent
          • elementMatches
          • getElementMatchingParent
          • getElementMatchingParents
          • getElementOffset
          • getNodeListIndex
          • trim
          • round
          • appendChildren
          • insertBefore
          • getBreakpoint
          • remove
          • triggerEvent
          • scrollWindowTo
          • tween
          • copyAttributes
          • wrapElement
          • range
          • getSiblingBefore
          • getSiblingAfter
          • getMatchingChild
          • getElementMatchingChildren
        • components / calendar-popover.js
        • components/ carousel.js
          • Carousel
          • _setParams
          • defaults
          • _whitelistedParams
          • _carouselItem
          • _init
          • remove
          • _pause
          • _setPause
          • _autoAdvance
          • _setupListeners
          • _removeListeners
          • _handleVisibleChildrenH
          • _forward
          • _back
          • _movestart
          • _move
          • _moveend
          • _resize
          • change
          • _touchstart
          • _touchmove
          • _touchend
          • _mousedown
          • _mousemove
          • _mouseup
          • _click
          • _velocity
          • _scrollToClicked
          • _scrollTo
          • _rafHandlerH
          • _rafCancel
          • _interiaScroll
          • _settle
          • _transformItems
          • _setTransformItems
          • _addTransform
          • _leftbound
          • _rightbound
          • _updateSelected
          • _selectedItem
          • _setTransform
        • components/ date-input.js
          • DateInput
          • _setParams
          • setError
          • _whitelistedParams
          • defaults
          • show
          • hide
          • remove
          • setValue
          • validate
          • updateInput
          • focus
          • focusNext
          • focusPrevious
          • hasPartialValue
          • _cacheElements
          • _parseParams
          • _initializeInputs
          • _initializeInputPieces
          • _initializeTypeaheadPiece
          • _initializeSelectPiece
          • _convertLabel
          • _validateTypeaheads
          • _validateTypeaheadBounds
          • _padTypeaheads
          • _padTypeahead
          • _hasTypeaheadValue
          • _validateSelects
          • _getMaxDaysInMonth
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _onVisibleChildren
          • update
          • _runTypeaheads
          • _updateClass
          • _getTypeaheadByElement
          • _showDateText
          • _hideDateText
          • _createDateTextEl
          • _getDateText
          • _onPieceChange
          • _onTypeaheadFocus
          • _onTypeaheadBlur
          • _onTypeaheadBackspace
          • _onTypeaheadEnd
          • _onInputChange
          • _onClick
        • components/ expand.js
          • Expand
          • _setParams
          • defaults
          • _whitelistedParams
          • expand
          • collapse
          • toggle
          • _cacheElements
          • _updateClasses
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _onClick
          • _onKeydown
        • components/ header.js
          • Header
          • _setParams
          • _whitelistedParams
          • defaults
          • update
          • checkFixed
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _getCurrentBreakpoint
          • _createPlaceholder
          • _removePlaceholder
          • _disablePlaceholderLinkTab
          • _createListMore
          • _determineInitialSize
          • _determineMenuSize
          • _listenForReadyStateChange
          • _isMenuBreakpoint
          • _getItemsToShowAndHide
          • _ensureActiveAtMoreSwapIndex
          • _addListMore
          • _removeListMore
          • _resetMenuChildren
          • _toggleCollapsed
          • _enableTopLevelToggling
          • _disableTopLevelToggling
          • _onResize
          • _onScroll
          • _onMoreClick
          • _onToggleClick
          • _onNavClick
        • components/ menu.js
          • Menu
          • _setParams
          • _whitelistedParams
          • defaults
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _toggleItem
          • _checkAnimation
          • _createMenuAnimationWrapper
          • _animateListChange
          • _appendList
          • _removeLastList
          • _removeAllCachedLists
          • _getNextList
          • _openItem
          • _closeItem
          • _activateItem
          • _activateItemParents
          • _deactivateItems
          • _deactivateItemSiblings
          • _openActiveParents
          • _cachedListContainsID
          • _onClick
          • _onFocus
          • _onBlur
        • components/ modal.js
          • Modal
          • _setParams
          • defaults
          • _whitelistedParams
          • open
          • close
          • _cacheElements
          • _updateClasses
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addWindowEventListeners
          • _removeWindowEventListeners
          • _onClick
          • _onModalClick
          • _onKeyup
        • components / number-picker.js
        • components/ number-selector.js
          • NumberSelector
          • _setParams
          • _whitelistedParams
          • defaults
          • value
          • increment
          • decrement
          • disable
          • enable
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _getMin
          • _getMax
          • _getStep
          • _getInputPropAsNumber
          • _getConformedNumber
          • _onClick
          • _onChange
        • components/ popover.js
          • Popover
          • _setParams
          • _whitelistedParams
          • defaults
          • open
          • close
          • toggle
          • setContent
          • pause
          • resume
          • _cacheElements
          • _moveContent
          • _determineDirectionAndAnchor
          • _updateAttributes
          • _updatePosition
          • _clearPosition
          • _updateCaretAnchorPosition
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addWindowEventListeners
          • _removeWindowEventListeners
          • _createContentEl
          • _createCaretEl
          • _onClick
          • _onContentClick
          • _onWindowClick
          • _onWindowResize
        • components/ progress-indicator.js
          • ProgressIndicator
          • _setParams
          • _whitelistedParams
          • defaults
          • set
          • _cacheElements
          • _cacheSize
          • _determineSize
          • _buildSVG
          • _parseNotes
          • _updateDOM
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _onResize
        • components/ range-slider.js
          • RangeSlider
          • _setParams
          • _whitelistedParams
          • defaults
          • start
          • move
          • stop
          • setValue
          • increment
          • decrement
          • remove
          • _cacheElements
          • _cacheSize
          • _updateHandlePosition
          • _updateActiveClasses
          • _updateDisabledClasses
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addMoveEventListeners
          • _removeMoveEventListeners
          • _onTouchStart
          • _onTouchMove
          • _onTouchEnd
          • _onMouseDown
          • _onMouseMove
          • _onMouseUp
          • _onVisibleChildren
          • _onResize
          • _onFocus
          • _onKeydown
          • _onBlur
          • _onChange
          • _onClick
        • components / scroll-to-top.js
        • components/ select-input.js
          • SelectInput
          • _setParams
          • _whitelistedParams
          • defaults
          • getValue
          • setValue
          • setOptions
          • setLabel
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _updateClass
          • _onFocus
          • _onBlur
          • _onInput
        • components/ slider.js
          • Slider
          • _setParams
          • _whitelistedParams
          • defaults
          • start
          • move
          • stop
          • setValue
          • increment
          • decrement
          • remove
          • _cacheElements
          • _cacheSize
          • _updateHandlePosition
          • _updateActiveClasses
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addMoveEventListeners
          • _removeMoveEventListeners
          • _truncateValueText
          • _onTouchStart
          • _onTouchMove
          • _onTouchEnd
          • _onMouseDown
          • _onMouseMove
          • _onMouseUp
          • _onMouseOut
          • _onResize
          • _onFocus
          • _onKeydown
          • _onBlur
          • _onChange
          • _onClick
          • _onWindowClick
        • components / step-indicator.js
        • components/ table.js
          • Table
          • _setParams
          • _whitelistedParams
          • defaults
          • disableCell
          • enableCell
          • disableRow
          • enableRow
          • disableColumn
          • enableColumn
          • remove
          • activateRow
          • activateRows
          • deactivateRow
          • deactivateRows
          • getActiveRows
          • _cacheElements
          • _parseParams
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addResizeListeners
          • _removeResizeListeners
          • _toggleRowActive
          • _makeRowActive
          • _makeRowInActive
          • _toggleRowsActive
          • _toggleSelectAll
          • _uncheckSelectAll
          • _deactivateAllInputs
          • _deactivateInputs
          • _deactivateInput
          • _activateInputs
          • _activateInput
          • _activateInputOrFocusDown
          • _disableRowsColumnsCells
          • _focusUp
          • _focusDown
          • _focusUpDown
          • _focusLeft
          • _focusRight
          • _focusLeftRight
          • _checkDoubleClick
          • _clearClicked
          • _editRow
          • _cancelRow
          • _saveRow
          • _deleteRow
          • _confirmDelete
          • _updateBindings
          • _initResize
          • _initRows
          • _sizeColumns
          • _initExpands
          • _onBeforeExpand
          • _onClick
          • _onChange
          • _onFocus
          • _onBlur
          • _onKeydown
          • _onTouchstart
          • _onTouchend
          • _onTouchHold
          • _onMouseDown
          • _onMouseMove
          • _onMouseUp
        • components/ tabs.js
          • Tabs
          • _setParams
          • _whitelistedParams
          • defaults
          • setActive
          • start
          • stop
          • move
          • focus
          • remove
          • update
          • _findPanelByName
          • _findPanelByTab
          • _findTabByPanel
          • _findTabByChildElement
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addMoveEventListeners
          • _removeMoveEventListeners
          • _determineSize
          • _determineMinMax
          • _enableAnimation
          • _disableAnimation
          • _updatePosition
          • _checkX
          • _onTabListClick
          • _onResize
          • _onTouchStart
          • _onTouchMove
          • _onTouchEnd
          • _onMouseDown
          • _onMouseMove
          • _onMouseUp
          • _onScroll
          • _onScrollEnd
          • _onLeftClick
          • _onRightClick
          • _onFocus
          • _onBlur
        • components/ text-input.js
          • TextInput
          • _setParams
          • _whitelistedParams
          • defaults
          • show
          • hide
          • validate
          • setError
          • clearError
          • setWarning
          • clearWarning
          • setSuccess
          • clearSuccess
          • clearMessages
          • setMessage
          • _showMessage
          • _hideMessage
          • _isMessageVisible
          • _cacheElements
          • _parseParams
          • _setCharactersCount
          • _setTextareaHeight
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _updateClass
          • _onFocus
          • _onBlur
          • _onInput
          • _onClearClick
          • _onTogglePasswordViewHide
        • components/ toggle-switch.js
          • ToggleSwitch
          • _getElementMatchingParent
          • defaults
          • toggle
          • activate
          • deactivate
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _onKeydown
        • components/ toolbar.js
          • Toolbar
          • _setParams
          • defaults
          • _whitelistedParams
          • toolbarItem
          • toggleDropdown
          • handleClick
          • _closeAll
          • _getOpenItems
          • _closeItems
          • _init
          • _setupListeners
          • _removeListeners
          • remove
          • _handleBlurH
          • _handleFocusH
          • _focusLast
          • _handleKeyDownH
          • _handleVisibleChildrenH
          • _handleWindowClickH
          • _toggleShowMore
          • _positionShowMore
          • _handleResizeH
          • _calculateStyles
          • _prioritySort
          • _orderSort
          • change
        • helpers/ animate-height.js
          • getInverseToggleValue
          • animateHeight
        • helpers/ build-select.js
          • buildSelect
        • helpers/ date-select.js
          • DateSelect
          • _setParams
          • _whitelistedParams
          • defaults
          • getValue
          • setValue
          • setOptions
          • setLabel
          • _createDefaultElement
          • _createSelect
          • _getDefaultMonthNames
          • _getTypeText
          • _bindEventListenerCallbacks
          • _onSelectChange
        • helpers/ date-typeahead.js
          • DateTypeahead
          • _setParams
          • _whitelistedParams
          • defaults
          • getValue
          • setValue
          • run
          • pause
          • resume
          • _createDefaultElement
          • _createTypeahead
          • _bindEventListenerCallbacks
          • _lengthToFormat
          • _checkValidity
          • _onTypeaheadChange
          • _onTypeaheadFocus
          • _onTypeaheadBlur
          • _onTypeaheadBackspace
          • _onTypeaheadEnd
        • helpers/ date.js
          • create
          • year
          • year
          • month
          • month
          • day
          • day
          • set
          • getMonthName
          • monthName
          • getMonthNames
          • getMonthNameShort
          • monthNameShort
          • getMonthNamesShort
          • setMonthNames
          • setMonthNamesShort
          • getDayOfWeek
          • dayOfWeek
          • getDayName
          • dayName
          • getDayNames
          • getDayNameShort
          • dayNameShort
          • getDayNamesShort
          • setDayNames
          • setDayNamesShort
          • getWeekStartsOn
          • setWeekStartsOn
          • now
          • getNextYear
          • nextYear
          • getWeekStart
          • weekStart
          • getMonthStart
          • monthStart
          • getNextWeek
          • nextWeek
          • getNextDay
          • nextDay
          • getNextMonth
          • nextMonth
          • getPreviousYear
          • previousYear
          • getPreviousWeek
          • previousWeek
          • getPreviousDay
          • previousDay
          • getPreviousMonth
          • previousMonth
          • getMonthEnd
          • monthEnd
          • equal
          • equalDay
          • equalWeek
          • equalMonth
          • equalYear
          • before
          • beforeDay
          • beforeWeek
          • beforeMonth
          • beforeYear
          • after
          • afterDay
          • afterWeek
          • afterMonth
          • afterYear
          • earliest
          • latest
          • clone
          • _checkComparisonArgs
          • _instanceCheck
          • _clearCache
        • helpers/ debounce.js
          • debounce
        • helpers/ each.js
          • each
        • helpers/ outer-height.js
          • outerHeight
        • helpers / pad-number.js
        • helpers/ parse-date-format.js
          • map
          • getValues
          • getString
          • parseDateFormat
        • helpers / set-caret.js
        • helpers/ store-form-data.js
          • findAll
          • store
          • restore
          • clear
        • helpers/ transform.js
          • transform
        • helpers/ typeahead.js
          • Typeahead
          • _setParams
          • _whitelistedParams
          • defaults
          • run
          • addCharacterAtIndex
          • addCharacterAtCaret
          • removeCharacterAtIndex
          • removeCharacterAtCaret
          • removeCharactersInRange
          • setValue
          • getValue
          • moveCaret
          • moveCaretToEnd
          • moveCaretToStart
          • pause
          • resume
          • clear
          • _cacheElements
          • _parseParams
          • _parseFormat
          • _parseCharacters
          • _createDefaultInputElement
          • _createDefaultPlaceholderElement
          • _getCharactersAllowedCount
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _getCaretStart
          • _getCaretEnd
          • _caretIsAtEnd
          • _setCaretPosition
          • _getCaretPositionTranslated
          • _getCaretStartTranslated
          • _getCaretEndTranslated
          • _setCaretPositionTranslated
          • _moveCaret
          • _emptyWhenOnlyPlaceholders
          • _maintainFocus
          • _updateWidth
          • _onKeydown
          • _onInput
          • _onFocus
          • _onBlur
          • _onPlaceholderClick
          • _onBackspace
        • index.js
          • exports
    • Roadmap
    • View All Resources
  • About
  • Contact
Spark
v1
  • Spark v3
  • Spark v2
  • Spark v1
  • Design Foundations
    • Animations
    • Color Palette
    • Iconography
    • Layout Guidelines
    • Sabre Logo Guidelines
    • Guiding Principles
    • Spark Themes
    • Typography
    • Voice and Tone
    • View All Foundations
  • UI Components
    • Containers & Navigation
      • Carousel
      • Expand & Collapse
      • Footer
      • Header & Navigation
      • Modals
      • Pagination and View More
      • Panels
      • Panel Menu
      • Responsive Grid
      • Scroll to Top
      • Tables
      • Tabs
      • Toolbar
    • Data Visualization
      • Introduction to Data Visualization
      • Color Palettes for Data Visualization
      • Bar Charts
      • Gauges
      • Line Graphs
      • Pie and Donut Charts
    • Form Elements
      • Buttons
      • Checkboxes
      • Date Selection
      • Multi-Select
      • Number Selector
      • Radio Buttons
      • Select Input
      • Sliders
      • Text Input
      • Toggles and Switches
    • Messaging & Content
      • Links
      • Messages
      • Popovers
      • Progress Indicators
      • Step Indicator
      • Tooltips
    • Page Templates
      • Sign-In Screen
      • Single Container Layout
      • Single Container with Side Menu Layout
      • Splash Screen
      • Tabbed Container Layout
      • Tabbed Container with Side Menu Layout
    • View All Components
  • Resources
    • Designer
      • Application Icons
    • Developer
      • Browser Support
      • Changelog
      • CSS Helper Classes
      • Javascript API Documentation
        • Back to Main Menu
        • Javscript API Documentation
        • Main
        • components/ base.js
          • BaseComponent
          • requestAnimationFrame
          • cancelAnimationFrame
          • breakpoints
          • exportjQuery
          • loadOrCreateJQueryInstance
          • setParams
          • unsetParams
          • toggleClass
          • addClass
          • removeClass
          • hasClass
          • getChildIndex
          • elementHasParent
          • elementMatches
          • getElementMatchingParent
          • getElementMatchingParents
          • getElementOffset
          • getNodeListIndex
          • trim
          • round
          • appendChildren
          • insertBefore
          • getBreakpoint
          • remove
          • triggerEvent
          • scrollWindowTo
          • tween
          • copyAttributes
          • wrapElement
          • range
          • getSiblingBefore
          • getSiblingAfter
          • getMatchingChild
          • getElementMatchingChildren
        • components / calendar-popover.js
        • components/ carousel.js
          • Carousel
          • _setParams
          • defaults
          • _whitelistedParams
          • _carouselItem
          • _init
          • remove
          • _pause
          • _setPause
          • _autoAdvance
          • _setupListeners
          • _removeListeners
          • _handleVisibleChildrenH
          • _forward
          • _back
          • _movestart
          • _move
          • _moveend
          • _resize
          • change
          • _touchstart
          • _touchmove
          • _touchend
          • _mousedown
          • _mousemove
          • _mouseup
          • _click
          • _velocity
          • _scrollToClicked
          • _scrollTo
          • _rafHandlerH
          • _rafCancel
          • _interiaScroll
          • _settle
          • _transformItems
          • _setTransformItems
          • _addTransform
          • _leftbound
          • _rightbound
          • _updateSelected
          • _selectedItem
          • _setTransform
        • components/ date-input.js
          • DateInput
          • _setParams
          • setError
          • _whitelistedParams
          • defaults
          • show
          • hide
          • remove
          • setValue
          • validate
          • updateInput
          • focus
          • focusNext
          • focusPrevious
          • hasPartialValue
          • _cacheElements
          • _parseParams
          • _initializeInputs
          • _initializeInputPieces
          • _initializeTypeaheadPiece
          • _initializeSelectPiece
          • _convertLabel
          • _validateTypeaheads
          • _validateTypeaheadBounds
          • _padTypeaheads
          • _padTypeahead
          • _hasTypeaheadValue
          • _validateSelects
          • _getMaxDaysInMonth
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _onVisibleChildren
          • update
          • _runTypeaheads
          • _updateClass
          • _getTypeaheadByElement
          • _showDateText
          • _hideDateText
          • _createDateTextEl
          • _getDateText
          • _onPieceChange
          • _onTypeaheadFocus
          • _onTypeaheadBlur
          • _onTypeaheadBackspace
          • _onTypeaheadEnd
          • _onInputChange
          • _onClick
        • components/ expand.js
          • Expand
          • _setParams
          • defaults
          • _whitelistedParams
          • expand
          • collapse
          • toggle
          • _cacheElements
          • _updateClasses
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _onClick
          • _onKeydown
        • components/ header.js
          • Header
          • _setParams
          • _whitelistedParams
          • defaults
          • update
          • checkFixed
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _getCurrentBreakpoint
          • _createPlaceholder
          • _removePlaceholder
          • _disablePlaceholderLinkTab
          • _createListMore
          • _determineInitialSize
          • _determineMenuSize
          • _listenForReadyStateChange
          • _isMenuBreakpoint
          • _getItemsToShowAndHide
          • _ensureActiveAtMoreSwapIndex
          • _addListMore
          • _removeListMore
          • _resetMenuChildren
          • _toggleCollapsed
          • _enableTopLevelToggling
          • _disableTopLevelToggling
          • _onResize
          • _onScroll
          • _onMoreClick
          • _onToggleClick
          • _onNavClick
        • components/ menu.js
          • Menu
          • _setParams
          • _whitelistedParams
          • defaults
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _toggleItem
          • _checkAnimation
          • _createMenuAnimationWrapper
          • _animateListChange
          • _appendList
          • _removeLastList
          • _removeAllCachedLists
          • _getNextList
          • _openItem
          • _closeItem
          • _activateItem
          • _activateItemParents
          • _deactivateItems
          • _deactivateItemSiblings
          • _openActiveParents
          • _cachedListContainsID
          • _onClick
          • _onFocus
          • _onBlur
        • components/ modal.js
          • Modal
          • _setParams
          • defaults
          • _whitelistedParams
          • open
          • close
          • _cacheElements
          • _updateClasses
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addWindowEventListeners
          • _removeWindowEventListeners
          • _onClick
          • _onModalClick
          • _onKeyup
        • components / number-picker.js
        • components/ number-selector.js
          • NumberSelector
          • _setParams
          • _whitelistedParams
          • defaults
          • value
          • increment
          • decrement
          • disable
          • enable
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _getMin
          • _getMax
          • _getStep
          • _getInputPropAsNumber
          • _getConformedNumber
          • _onClick
          • _onChange
        • components/ popover.js
          • Popover
          • _setParams
          • _whitelistedParams
          • defaults
          • open
          • close
          • toggle
          • setContent
          • pause
          • resume
          • _cacheElements
          • _moveContent
          • _determineDirectionAndAnchor
          • _updateAttributes
          • _updatePosition
          • _clearPosition
          • _updateCaretAnchorPosition
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addWindowEventListeners
          • _removeWindowEventListeners
          • _createContentEl
          • _createCaretEl
          • _onClick
          • _onContentClick
          • _onWindowClick
          • _onWindowResize
        • components/ progress-indicator.js
          • ProgressIndicator
          • _setParams
          • _whitelistedParams
          • defaults
          • set
          • _cacheElements
          • _cacheSize
          • _determineSize
          • _buildSVG
          • _parseNotes
          • _updateDOM
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _onResize
        • components/ range-slider.js
          • RangeSlider
          • _setParams
          • _whitelistedParams
          • defaults
          • start
          • move
          • stop
          • setValue
          • increment
          • decrement
          • remove
          • _cacheElements
          • _cacheSize
          • _updateHandlePosition
          • _updateActiveClasses
          • _updateDisabledClasses
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addMoveEventListeners
          • _removeMoveEventListeners
          • _onTouchStart
          • _onTouchMove
          • _onTouchEnd
          • _onMouseDown
          • _onMouseMove
          • _onMouseUp
          • _onVisibleChildren
          • _onResize
          • _onFocus
          • _onKeydown
          • _onBlur
          • _onChange
          • _onClick
        • components / scroll-to-top.js
        • components/ select-input.js
          • SelectInput
          • _setParams
          • _whitelistedParams
          • defaults
          • getValue
          • setValue
          • setOptions
          • setLabel
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _updateClass
          • _onFocus
          • _onBlur
          • _onInput
        • components/ slider.js
          • Slider
          • _setParams
          • _whitelistedParams
          • defaults
          • start
          • move
          • stop
          • setValue
          • increment
          • decrement
          • remove
          • _cacheElements
          • _cacheSize
          • _updateHandlePosition
          • _updateActiveClasses
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addMoveEventListeners
          • _removeMoveEventListeners
          • _truncateValueText
          • _onTouchStart
          • _onTouchMove
          • _onTouchEnd
          • _onMouseDown
          • _onMouseMove
          • _onMouseUp
          • _onMouseOut
          • _onResize
          • _onFocus
          • _onKeydown
          • _onBlur
          • _onChange
          • _onClick
          • _onWindowClick
        • components / step-indicator.js
        • components/ table.js
          • Table
          • _setParams
          • _whitelistedParams
          • defaults
          • disableCell
          • enableCell
          • disableRow
          • enableRow
          • disableColumn
          • enableColumn
          • remove
          • activateRow
          • activateRows
          • deactivateRow
          • deactivateRows
          • getActiveRows
          • _cacheElements
          • _parseParams
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addResizeListeners
          • _removeResizeListeners
          • _toggleRowActive
          • _makeRowActive
          • _makeRowInActive
          • _toggleRowsActive
          • _toggleSelectAll
          • _uncheckSelectAll
          • _deactivateAllInputs
          • _deactivateInputs
          • _deactivateInput
          • _activateInputs
          • _activateInput
          • _activateInputOrFocusDown
          • _disableRowsColumnsCells
          • _focusUp
          • _focusDown
          • _focusUpDown
          • _focusLeft
          • _focusRight
          • _focusLeftRight
          • _checkDoubleClick
          • _clearClicked
          • _editRow
          • _cancelRow
          • _saveRow
          • _deleteRow
          • _confirmDelete
          • _updateBindings
          • _initResize
          • _initRows
          • _sizeColumns
          • _initExpands
          • _onBeforeExpand
          • _onClick
          • _onChange
          • _onFocus
          • _onBlur
          • _onKeydown
          • _onTouchstart
          • _onTouchend
          • _onTouchHold
          • _onMouseDown
          • _onMouseMove
          • _onMouseUp
        • components/ tabs.js
          • Tabs
          • _setParams
          • _whitelistedParams
          • defaults
          • setActive
          • start
          • stop
          • move
          • focus
          • remove
          • update
          • _findPanelByName
          • _findPanelByTab
          • _findTabByPanel
          • _findTabByChildElement
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _addMoveEventListeners
          • _removeMoveEventListeners
          • _determineSize
          • _determineMinMax
          • _enableAnimation
          • _disableAnimation
          • _updatePosition
          • _checkX
          • _onTabListClick
          • _onResize
          • _onTouchStart
          • _onTouchMove
          • _onTouchEnd
          • _onMouseDown
          • _onMouseMove
          • _onMouseUp
          • _onScroll
          • _onScrollEnd
          • _onLeftClick
          • _onRightClick
          • _onFocus
          • _onBlur
        • components/ text-input.js
          • TextInput
          • _setParams
          • _whitelistedParams
          • defaults
          • show
          • hide
          • validate
          • setError
          • clearError
          • setWarning
          • clearWarning
          • setSuccess
          • clearSuccess
          • clearMessages
          • setMessage
          • _showMessage
          • _hideMessage
          • _isMessageVisible
          • _cacheElements
          • _parseParams
          • _setCharactersCount
          • _setTextareaHeight
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _updateClass
          • _onFocus
          • _onBlur
          • _onInput
          • _onClearClick
          • _onTogglePasswordViewHide
        • components/ toggle-switch.js
          • ToggleSwitch
          • _getElementMatchingParent
          • defaults
          • toggle
          • activate
          • deactivate
          • _cacheElements
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _onKeydown
        • components/ toolbar.js
          • Toolbar
          • _setParams
          • defaults
          • _whitelistedParams
          • toolbarItem
          • toggleDropdown
          • handleClick
          • _closeAll
          • _getOpenItems
          • _closeItems
          • _init
          • _setupListeners
          • _removeListeners
          • remove
          • _handleBlurH
          • _handleFocusH
          • _focusLast
          • _handleKeyDownH
          • _handleVisibleChildrenH
          • _handleWindowClickH
          • _toggleShowMore
          • _positionShowMore
          • _handleResizeH
          • _calculateStyles
          • _prioritySort
          • _orderSort
          • change
        • helpers/ animate-height.js
          • getInverseToggleValue
          • animateHeight
        • helpers/ build-select.js
          • buildSelect
        • helpers/ date-select.js
          • DateSelect
          • _setParams
          • _whitelistedParams
          • defaults
          • getValue
          • setValue
          • setOptions
          • setLabel
          • _createDefaultElement
          • _createSelect
          • _getDefaultMonthNames
          • _getTypeText
          • _bindEventListenerCallbacks
          • _onSelectChange
        • helpers/ date-typeahead.js
          • DateTypeahead
          • _setParams
          • _whitelistedParams
          • defaults
          • getValue
          • setValue
          • run
          • pause
          • resume
          • _createDefaultElement
          • _createTypeahead
          • _bindEventListenerCallbacks
          • _lengthToFormat
          • _checkValidity
          • _onTypeaheadChange
          • _onTypeaheadFocus
          • _onTypeaheadBlur
          • _onTypeaheadBackspace
          • _onTypeaheadEnd
        • helpers/ date.js
          • create
          • year
          • year
          • month
          • month
          • day
          • day
          • set
          • getMonthName
          • monthName
          • getMonthNames
          • getMonthNameShort
          • monthNameShort
          • getMonthNamesShort
          • setMonthNames
          • setMonthNamesShort
          • getDayOfWeek
          • dayOfWeek
          • getDayName
          • dayName
          • getDayNames
          • getDayNameShort
          • dayNameShort
          • getDayNamesShort
          • setDayNames
          • setDayNamesShort
          • getWeekStartsOn
          • setWeekStartsOn
          • now
          • getNextYear
          • nextYear
          • getWeekStart
          • weekStart
          • getMonthStart
          • monthStart
          • getNextWeek
          • nextWeek
          • getNextDay
          • nextDay
          • getNextMonth
          • nextMonth
          • getPreviousYear
          • previousYear
          • getPreviousWeek
          • previousWeek
          • getPreviousDay
          • previousDay
          • getPreviousMonth
          • previousMonth
          • getMonthEnd
          • monthEnd
          • equal
          • equalDay
          • equalWeek
          • equalMonth
          • equalYear
          • before
          • beforeDay
          • beforeWeek
          • beforeMonth
          • beforeYear
          • after
          • afterDay
          • afterWeek
          • afterMonth
          • afterYear
          • earliest
          • latest
          • clone
          • _checkComparisonArgs
          • _instanceCheck
          • _clearCache
        • helpers/ debounce.js
          • debounce
        • helpers/ each.js
          • each
        • helpers/ outer-height.js
          • outerHeight
        • helpers / pad-number.js
        • helpers/ parse-date-format.js
          • map
          • getValues
          • getString
          • parseDateFormat
        • helpers / set-caret.js
        • helpers/ store-form-data.js
          • findAll
          • store
          • restore
          • clear
        • helpers/ transform.js
          • transform
        • helpers/ typeahead.js
          • Typeahead
          • _setParams
          • _whitelistedParams
          • defaults
          • run
          • addCharacterAtIndex
          • addCharacterAtCaret
          • removeCharacterAtIndex
          • removeCharacterAtCaret
          • removeCharactersInRange
          • setValue
          • getValue
          • moveCaret
          • moveCaretToEnd
          • moveCaretToStart
          • pause
          • resume
          • clear
          • _cacheElements
          • _parseParams
          • _parseFormat
          • _parseCharacters
          • _createDefaultInputElement
          • _createDefaultPlaceholderElement
          • _getCharactersAllowedCount
          • _bindEventListenerCallbacks
          • _addEventListeners
          • _removeEventListeners
          • _getCaretStart
          • _getCaretEnd
          • _caretIsAtEnd
          • _setCaretPosition
          • _getCaretPositionTranslated
          • _getCaretStartTranslated
          • _getCaretEndTranslated
          • _setCaretPositionTranslated
          • _moveCaret
          • _emptyWhenOnlyPlaceholders
          • _maintainFocus
          • _updateWidth
          • _onKeydown
          • _onInput
          • _onFocus
          • _onBlur
          • _onPlaceholderClick
          • _onBackspace
        • index.js
          • exports
    • Roadmap
    • View All Resources
  • About
  • Contact
    • Containers & Navigation
      • Carousel
      • Expand & Collapse
      • Footer
      • Header & Navigation
      • Modals
      • Pagination and View More
      • Panels
      • Panel Menu
      • Responsive Grid
      • Scroll to Top
      • Tables
      • Tabs
      • Toolbar
    • Data Visualization
      • Introduction to Data Visualization
      • Color Palettes for Data Visualization
      • Bar Charts
      • Gauges
      • Line Graphs
      • Pie and Donut Charts
    • Form Elements
      • Buttons
      • Checkboxes
      • Date Selection
      • Multi-Select
      • Number Selector
      • Radio Buttons
      • Select Input
      • Sliders
      • Text Input
      • Toggles and Switches
    • Messaging & Content
      • Links
      • Messages
      • Popovers
      • Progress Indicators
      • Step Indicator
      • Tooltips
    • Page Templates
      • Sign-In Screen
      • Single Container Layout
      • Single Container with Side Menu Layout
      • Splash Screen
      • Tabbed Container Layout
      • Tabbed Container with Side Menu Layout

    Text Input

    Text input fields allow users to enter or edit text.

    • Overview
    • Guidelines
    • Developer

    Standard Text Input Example


    When to Use

    • Use when there is not a predefined set of answers from which a user can choose.
    • Use when a user may prefer to paste in a response.

    When Not to Use

    • Do not use when there is a limited set of options from which a user can choose. Instead, consider a select input in these instances to minimize errors caused by incorrect formatting and typing.

    Variations

    • Standard Text Input Example (shown above)
    • Single Line Input with Icon Example
    • Disabled Input Example
    • Multi-line Text Input Example
    • Type-Ahead Input Examples
    • Input Validation Examples
    • Character Count Examples
    • Variable Height Text Area Example

    Usage

    • Place labels inside the input field to allow users to quickly scan the label and enter corresponding data.
    • Use hint text (also called ghost text) when there is a required format for entering data or when additional information may be needed to guide the user’s response. Hint text animates in as soon as the user clicks/taps into the field (see example below). This provides additional details when the user is focused on the field without cluttering the page when he/she is not.
    • Mask sensitive information (such as passwords). Consider adding a control to allow users to unmask data that they have just typed. This is helpful on mobile devices where users tend to make more typing errors.

    Variations

    Multi-line Input

    Multi-line inputs should be used when the length of information being asked for is unpredictable (e.g. description, general notes etc.). A multi-line input should adopt the standard length of surrounding form fields and automatically vertically input once the user reaches the right side of the form.


    Single Line Input with Icon Example

    Processing and actionable icons (dropdown arrows, progress indicator, clear icon, etc.) appear on the right side of the form field. Refer to Icons for further application.


    Disabled Input

    Disabled inputs display if information is required prior to completing that particular form field. The visual distinction is important in helping guide the user’s inputs and creating transparency within the form elements.


    Type Ahead Input Examples

    Type Ahead Phone


    Type Ahead Social Security


    When to Use

    • Use type ahead when you want to provide an example of an acceptable input. This is important when a very specific format is required to successfully fill out a form (for example a 10-digit phone number or Social Security Number)

    When Not to Use

    • Use type ahead when you want to provide an example of an acceptable input. This is important when a very specific format is required to successfully fill out a form (for example a 10-digit phone number or Social Security Number)

    Input Validation Examples

    Input validation occurs only after a user interacts with a field (meaning the user progressed to another field). Immediate inline validation only occurs when the input is directly correlated with levels of success (e.g. password strength indicator). Error recognition and validation communicates why the input is incorrect along with how to fix the issue. See Voice and Tone for guidance on writing clear and friendly messaging.

    Email Input Validation


    Password Strength Indicator


    Character Count Examples

    Character Count Input


    Hard Character Count Input


    Variable Height Textarea w/ Soft Character Count Example

    Soft character count will allow the user to keep adding input, but just display an error by how many characters they are over


    When to Use

    • Use a character counter in fields in which a character restriction is in place, or it is useful to know how many characters have been typed.

    Additional Guidelines

    • Limiting input length can be useful in scenarios in which design and layout principles limit the amount of content that can be displayed.
    • The character count works its way down from the max number of characters. The characters being typed are reflected in the remaining balance. Once the counter reaches 0, no more characters may be entered and the number turns red.

    Optional vs. Required Field Indicators

    Avoid asking the user to input information that is not required, as this creates an unnecessary burden for the user and decreases completion rates (in sign-up/purchase scenarios). When optional fields can’t be avoided, indicate that they are optional by displaying “Optional” to the right of the label.


    Single-line Input

    • HTML
    • JS
    <label class="spark-input">
      <input class="spark-input__field" name="example1" placeholder="Enter Full Name..." role="textbox">
      <span class="spark-label">What is your name?</span>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input');
    var inputInstance = new Spark.TextInput(el);
    
    // jQuery
    $('.spark-input').sparkTextInput();

    Developer Notes

    Order Matters The <input> element must be the first item inside of the text input container, otherwise the disabled state will not work properly.

    The placeholder text will not be immediately visible. Any vital text should instead be placed into the .spark-label field.

    Multi-line Input

    • HTML
    • JS
    <label class="spark-input" data-characters-remaining>
      <textarea class="spark-input__field" name="example1" data-maxlength-soft="140" placeholder="A tweet or something." role="textbox"></textarea>
      <span class="spark-label">This has a variable-height text area with a soft remaining count.</span>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input');
    var inputInstance = new Spark.TextInput(el);
    
    // jQuery
    $('.spark-input').sparkTextInput();

    Developer Notes

    Any textarea element inside of the .spark-input-container automatically adjusts its content height if the input has the associated JavaScript applied.

    Single Line Input with Icon

    • HTML
    • JS
    <label class="spark-input">
      <input class="spark-input__field" name="example1" placeholder="Enter First Name..." role="textbox">
      <span class="spark-label">Where are you going? <span class="spark-thin">(Optional)</span></span>
      <div class="spark-input__addon"><i class="spark-icon-airplane spark-icon--md"></i></div>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input');
    var inputInstance = new Spark.TextInput(el);
    
    // jQuery
    $('.spark-input').sparkTextInput();

    Developer Notes

    Icon content should be placed inside an element with a class of .spark-input__addon. It is also possible to add an icon class directly to the .spark-input__addon element.

    Optional vs. Required Field Indicators

    • HTML
    • JS
    <label class="spark-input">
      <input class="spark-input__field" name="example1" placeholder="Enter Full Name..." role="textbox">
      <span class="spark-label">What is your name? <span class="spark-thin">(Optional)</span></span>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input');
    var inputInstance = new Spark.TextInput(el);
    
    // jQuery
    $('.spark-input').sparkTextInput();

    Developer Notes

    Use a class of .spark-thin around the optional text to differentiate from the label text.

    Disabled Input Example

    • HTML
    • JS
    <label class="spark-input">
      <input class="spark-input__field" name="example1" placeholder="Enter First Name..." disabled role="textbox">
      <span class="spark-label">Not to be touched.</span>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input');
    var inputInstance = new Spark.TextInput(el);
    
    // jQuery
    $('.spark-input').sparkTextInput();

    Developer Notes

    Adding the disabled attribute to the input element inside of the input container will style the related elements accordingly.

    Type Ahead Phone

    • HTML
    • JS
    <label class="spark-input">
      <input type="phone" class="spark-input__field" name="example1" placeholder="(555) 555-5555" data-typeahead data-typeahead-format="(\d\d\d) \d\d\d-\d\d\d\d" role="textbox">
      <span class="spark-input__placeholder"></span>
      <span class="spark-label">What is your phone number?</span>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input');
    var inputInstance = new Spark.TextInput(el);
    
    // jQuery
    $('.spark-input').sparkTextInput();

    Type Ahead Social Security

    • HTML
    • JS
    <label class="spark-input">
      <input type="phone" class="spark-input__field" name="example1" placeholder="000-00-0000" data-typeahead data-typeahead-format="\d\d\d-\d\d-\d\d\d\d" role="textbox">
      <span class="spark-input__placeholder"></span>
      <span class="spark-label">What is your SSN?</span>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input');
    var inputInstance = new Spark.TextInput(el);
    
    // jQuery
    $('.spark-input').sparkTextInput();

    Developer Notes

    The format of the type ahead must be defined in two ways. First, set the placeholder attribute in the proper format you would like to enforce. Then, add the data-typeahead attribute as well as the data-typeahead-format attribute. The format should be the same as what is defined in the placeholder with numbers substituted for the digit escape character (\d).

    Note: typeahead functionality is currently disabled on Android devices due to a defect in how Chrome reports keyboard events on that platform. A solution is in active development.

    Email Input Validation

    • HTML
    • JS
    <label class="spark-input" data-error>
      <input class="spark-input__field" type="email" name="example1" placeholder="you@address.com" value="sdf@.com" required role="textbox">
      <span class="spark-label">What is your email?</span>
      <span class="spark-input__message">Invalid email format.</span>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input');
    var inputInstance = new Spark.TextInput(el);
    
    // jQuery
    $('.spark-input').sparkTextInput();

    Password Strength Indicator

    • HTML
    • JS
    <label class="spark-input" id="validate-password">
      <input type="password" class="spark-input__field" name="example1" placeholder="What is your password?" role="textbox">
      <span class="spark-label">This has a password strength indicator.</span>
      <span class="spark-input__message"></span>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input[type="password"]');
    var inputInstance = new Spark.TextInput(el, {
      onChange: function(inst, newVal) {
        if (val.length === 0) {
          inst.clearMessages();
        }
        else if (val.length > 6) {
          inst.setSuccess('<b>NAILED IT!</b> But will you remember it?');
        }
        else if (val.length <= 6 && val.length > 3) {
          inst.setWarning('<b>AVERAGE</b> (at best).');
        }
        else if (val.length <= 3) {
          inst.setError('<b>SHOCKINGLY BAD.</b> Try again.');
        }
      }
    });
    
    // jQuery
    $('.spark-input[type="password"]').sparkTextInput({
      onChange: function(inst, newVal) {
        if (val.length === 0) {
          inst.clearMessages();
        }
        else if (val.length > 6) {
          inst.setSuccess('<b>NAILED IT!</b> But will you remember it?');
        }
        else if (val.length <= 6 && val.length > 3) {
          inst.setWarning('<b>AVERAGE</b> (at best).');
        }
        else if (val.length <= 3) {
          inst.setError('<b>SHOCKINGLY BAD.</b> Try again.');
        }
      }
    });

    Developer Notes

    Serveral validation provided in different levels. validate is the overview validation callback function for Spark Text Input with a default implementation. It can be configured and override by user in constructor: new Spark.TextInput(el, {validate: function() { }});.

    onValidate is another validate callback function which only available when the default validate callback function is not overriden. onValidate should be used with validatePattern together. validatePattern should be a custom regular expression whose result will be used as second argument in onValidate callback function. The arguments of onValidate are the instance of Spark Text Input, result of regular expression and the current value of Text Input.

    Validation also can be performed by hooking into the Spark.TextInput JavaScript class. When instantiating the class, provide an options object with a callback function set to the onChange key as the second argument. Ex. new Spark.TextInput(el, {onChange: function(input, val) { }});

    The callback function will be passed two parameters: the instance of Spark.TextInput and the current value of the input. Using the clearMessages, setSuccess, setWarning or setError methods on the Spark.TextInput instance, you can manipulate which kind of error (if any) is shown. Only one state can be set at any time.

    If you don’t wish to or cannot use the Spark.TextInput JavaScript class, adding data-error="true", data-warning="true" or data-success="true" to .spark-input will affect the color of the input. Setting the content of .spark-input__message will change the message displayed below the input.

    Character Count Input

    • HTML
    • JS
    <label class="spark-input" data-characters>
      <input class="spark-input__field" name="example1" placeholder="Where you're from, your interests, etc." value="test" role="textbox">
      <span class="spark-label">Tell us about yourself</span>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input');
    var inputInstance = new Spark.TextInput(el);
    
    // jQuery
    $('.spark-input').sparkTextInput();

    Hard Character Count Input

    • HTML
    • JS
    <label class="spark-input" data-characters-remaining>
      <input class="spark-input__field" name="example1" maxlength="20" placeholder="A tweet or something." role="textbox">
      <span class="spark-label">This has a firm remaining count.</span>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input');
    var inputInstance = new Spark.TextInput(el);
    
    // jQuery
    $('.spark-input').sparkTextInput();

    Variable Height Textarea w/ Soft Character Count

    • HTML
    • JS
    <label class="spark-input" data-characters-remaining>
      <textarea class="spark-input__field" name="example1" data-maxlength-soft="140" placeholder="A tweet or something." role="textbox"></textarea>
      <span class="spark-label">This has a variable-height text area with a soft remaining count.</span>
    </label>
    // Vanilla JS
    var el = document.querySelector('.spark-input');
    var inputInstance = new Spark.TextInput(el);
    
    // jQuery
    $('.spark-input').sparkTextInput();

    Developer Notes

    To implement a soft character count, simply add the data-characters attribute to the .spark-input-container element. This will count up from 0. To implement a hard character count that counts down from the maximum number allowed, add the data-characters-remaining attribute to the .spark-input-container element and utilize the maxlength property on the corresponding input element.

    • Standard Text Input Example
      • When to Use
      • When Not to Use
      • Variations
    • Usage
    • Variations
      • Multi-line Input
      • Single Line Input with Icon Example
      • Disabled Input
      • Type Ahead Input Examples
        • Type Ahead Phone
        • Type Ahead Social Security
        • When to Use
        • When Not to Use
      • Input Validation Examples
        • Email Input Validation
        • Password Strength Indicator
      • Character Count Examples
        • Character Count Input
        • Hard Character Count Input
        • Variable Height Textarea w/ Soft Character Count Example
        • When to Use
        • Additional Guidelines
      • Optional vs. Required Field Indicators
      • Single-line Input
        • Developer Notes
      • Multi-line Input
        • Developer Notes
      • Single Line Input with Icon
        • Developer Notes
      • Optional vs. Required Field Indicators
        • Developer Notes
      • Disabled Input Example
        • Developer Notes
      • Type Ahead Phone
      • Type Ahead Social Security
        • Developer Notes
      • Email Input Validation
      • Password Strength Indicator
        • Developer Notes
      • Character Count Input
      • Hard Character Count Input
      • Variable Height Textarea w/ Soft Character Count
        • Developer Notes
    © 2015-16 Sabre
    • Contact Us
    • Report a Bug