Reuse a Custom Component | AIUI | Rokid

Register a component through usingComponents in the Page's <script def>, then use it in the template like a built-in component.

Reuse a Custom Component

Register a component through usingComponents in the Page's <script def>, then use it in the template like a built-in component.

Complete the Example

Register a component through usingComponents in the Page's <script def>, then use it in the template like a built-in component.

<script def>
{
  "usingComponents": {
    "status-card": "components/status-card"
  }
}
</script>

<page>
  <status-card title="Runtime status" value="Healthy"></status-card>
</page>

See Custom Components for properties, events, and component lifecycle.