Skip to content

lit-ui-router / UiSrefActiveDirective

Class: UiSrefActiveDirective

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

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:369
activeClassesstring[][]classes applied while any target is activepackages/lit-ui-router/src/ui-sref-active.ts:340
ariaCurrentValue| false | AriaCurrentValue | AriaCurrentValues | undefinedundefinedundefined = default (on for link elements)packages/lit-ui-router/src/ui-sref-active.ts:344
enteringboolean | undefinedundefinedwhether a running transition enters a targetpackages/lit-ui-router/src/ui-sref-active.ts:373
exactboolean | undefinedundefinedwhether any target is exactly active, or undefined before the first statuspackages/lit-ui-router/src/ui-sref-active.ts:371
exactClassesstring[][]classes applied while any target is exactly activepackages/lit-ui-router/src/ui-sref-active.ts:342
exitingboolean | undefinedundefinedwhether a running transition exits a targetpackages/lit-ui-router/src/ui-sref-active.ts:375
optionsTransitionOptions{}the explicit target transition optionspackages/lit-ui-router/src/ui-sref-active.ts:366
paramsRawParams{}the explicit target state paramspackages/lit-ui-router/src/ui-sref-active.ts:364
statestring | undefinedundefinedthe explicit target state name, or undefined in container modepackages/lit-ui-router/src/ui-sref-active.ts:362
targetStatesSet<TargetState>undefinedevery target this directive watches: the explicit one, or the enclosed links'packages/lit-ui-router/src/ui-sref-active.ts:378