1.0.1 • Published 6 years ago

@veams/component-toggler v1.0.1

Weekly downloads
11
License
MIT
Repository
github
Last release
6 years ago

Toggler

Description

Represents a simple toggler component with global event binding when necessary.


Requirements


Installation

veams install component toggler
veams -i c toggler

Fields

toggler

Settings

OptionTypeDefaultDescription
settings.togglerContextClassesStringdefaultContext class.
settings.togglerClassesStringModifier classes.
settings.togglerJsOptionsObjectOptions object which gets stringified.
settings.togglerJsModuleBooleanSpecify if component is a Javascript module or not.
settings.togglerJsModuleWithContextStringReference to specific Javascript module toggler context.
settings.togglerIdStringId to reference specific toggler component instance.
settings.attributesArrayList of attributes that consist of name value pairs.

Content

OptionTypeDefaultDescription
content.togglerFieldStringAdd description.

JavaScript Options

The module gives you the possibility to override default options:

OptionTypeDefaultDescription
a11yFocusKeyClassString'a11y-focus-key'Class for the accessibility focus key.
calculatingClassString'is-calculating'Class used to display calculating state.
closeClassString'is-closed'Class when toggler is closed.
contextBooleanfalseContext property that gets passed to toggler open event.
dataMaxAttrString'data-js-height'Dynamic max height attribute.
globalEventString''Reference to global event that when triggered calls toggle method.
globalEventIdString''Compare toggler's globaleventid with the globaleventid of the object that triggered the toggle method to determine if toggle should be run or aborted.
openClassString'is-open'Class when toggler is open.
setOverflowBooleanfalseSpecify if overflow should be set or not.
toggleTabindexElemsString''Selector that targets elements to toggle tab-index.

SASS Options

OptionTypeDefaultDescription
$toggler-animation-duration-stdString500msDuration of the toggle animation.
$toggler-animation-easing-stdFunctionease-in-outEasing method of the animation.

1.0.1

6 years ago

1.0.0

6 years ago