Skip to content

lit-ui-router / UiSrefActiveDirective

Class: UiSrefActiveDirective

Defined in: packages/lit-ui-router/src/ui-sref-active.ts:217

Directive class that adds CSS classes based on active state.

This directive is used internally by the uiSrefActive directive function. It watches the current router state and applies CSS classes to elements when their associated states are active.

The directive can operate in two modes:

  1. Explicit state: Provide a state name to watch
  2. Container mode: Automatically watch nested uiSref directives

See

Extends

Properties

PropertyTypeDefault valueDescriptionDefined in
activeboolean | undefinedundefinedwhether any target is active, or undefined before the first statuspackages/lit-ui-router/src/ui-sref-active.ts:265
activeClassesstring[][]classes applied while any target is activepackages/lit-ui-router/src/ui-sref-active.ts:236
ariaCurrentValue| false | AriaCurrentValue | AriaCurrentValues | undefinedundefinedundefined = default (on for link elements)packages/lit-ui-router/src/ui-sref-active.ts:240
enteringboolean | undefinedundefinedwhether a running transition enters a targetpackages/lit-ui-router/src/ui-sref-active.ts:269
exactboolean | undefinedundefinedwhether any target is exactly active, or undefined before the first statuspackages/lit-ui-router/src/ui-sref-active.ts:267
exactClassesstring[][]classes applied while any target is exactly activepackages/lit-ui-router/src/ui-sref-active.ts:238
exitingboolean | undefinedundefinedwhether a running transition exits a targetpackages/lit-ui-router/src/ui-sref-active.ts:271
optionsTransitionOptions{}the explicit target transition optionspackages/lit-ui-router/src/ui-sref-active.ts:262
paramsRawParams{}the explicit target state paramspackages/lit-ui-router/src/ui-sref-active.ts:260
statestring | undefinedundefinedthe explicit target state name, or undefined in container modepackages/lit-ui-router/src/ui-sref-active.ts:258
targetStatesSet<TargetState>undefinedevery target this directive watches: the explicit one, or the enclosed links'packages/lit-ui-router/src/ui-sref-active.ts:274