你正在查看 Lit 的旧版本文档。点击 这里查看最新版本。

Internal demos

This is an internal only page to demonstrate various ways to embed code into Markdown docs.

Just highlight some code, non-interactive. Uses the same renderer as playground, so highlight styles will match.

```js
html`<h1>Hello ${name}</h1>`
```
html`<h1>Hello ${name}</h1>`

One editable file from a project, with a preview right below.

Arguments:

  1. Path of the project dir from samples/PATH/project.json.
  2. Filename from project to show.

Additional project.json config options:

  • previewHeight: Height of the preview in pixels (default 120px).
{% playground-example "v2-docs/templates/define" "my-element.ts" %}

Fully editable playground project, with preview to the side.

Arguments:

  1. (Required) Path of the project dir from samples/PATH/project.json.
{% playground-ide "v2-docs/templates/define" %}

Use extends in your project.config to inherit from the site base configuration that resolve imports to lit-next:

{
"extends": "/samples/v2-base.json",
}