LibraryActive

Lit Directives

Built-in template directives for Lit, including asyncAppend, asyncReplace, cache, choose, classMap, guard, and more.

Open source page ↗

Product features

Product features

asyncAppend

Renders items of an async iterable, appending new values after previous values.

AsyncAppendDirective

asyncReplace

Renders items of an async iterable, replacing previous values.

cache

Caches rendered DOM when re-rendering templates.

choose

Chooses one of several templates based on a condition.

classMap

Sets classes on an element from an object of class names to boolean values.

commitValue ( value , index ): void

Contents: Directives

Details

Directives

guard

Prevents re-rendering of a template unless one of its dependencies changes.

ifDefined

Sets an attribute if the value is defined and removes it if undefined.

Import

isConnected : boolean

Methods and properties

new AsyncAppendDirective ( partInfo ): AsyncAppendDirective

Parameters

repeat

Renders a list of items with efficient DOM updates and keyed reordering.

Signature