A sentinel value that signals that a value was handled by a directive and should not be written to the DOM.
A sentinel value that signals a NodePart to fully clear its content.
Brands a function as a directive factory function so that lit-html will call the function during template rendering, rather than passing as a value.
A directive is a function that takes a Part as an argument. It has the
signature: (part: Part) => void
.
A directive factory is a function that takes arguments for data and configuration and returns a directive. Users of directive usually refer to the directive factory as the directive. For example, "The repeat directive".
Usually a template author will invoke a directive factory in their template with relevant arguments, which will then return a directive function.
Here's an example of using the repeat()
directive factory that takes an
array and a function to render an item:
html`<ul><${repeat(items, (item) => html`<li>${item}</li>`)}</ul>`
When repeat
is invoked, it returns a directive function that closes over
items
and the template function. When the outer template is rendered, the
return directive function is called with the Part for the expression.
repeat
then performs it's custom logic to render multiple items.
The directive factory function. Must be a function that returns a
function of the signature (part: Part) => void
. The returned function will
be called with the part object.
Interprets a template literal as an HTML template that can efficiently render to and update a container.
Removes nodes, starting from start
(inclusive) to end
(exclusive), from
container
.
Renders a template result or other value to a container.
To update a container with new values, reevaluate the template literal and
call render
with the new result.
Any value renderable by NodePart - typically a TemplateResult
created by evaluating a template tag like html
or svg
.
A DOM parent to render to. The entire contents are either replaced, or efficiently updated if the same result type was previous rendered there.
RenderOptions for the entire render tree rendered to this container. Render options must not change between renders to the same container, as those changes will not effect previously rendered DOM.
Reparents nodes, starting from start
(inclusive) to end
(exclusive),
into another container (could be the same container), before before
. If
before
is null, it appends the nodes to the container.
Interprets a template literal as an SVG template that can efficiently render to and update a container.
The default TemplateFactory which caches Templates keyed on result.type and result.strings.
Generated using TypeDoc
Main lit-html module.
Main exports: