{% extends "default.njk" %}
{# Find the component based on the `tag` front matter #}
{% set component = getComponent(component.tagName) %}
{% block content %}
{# Avoid breaking if the component is not correct #}
{% if component and component.tagName %}
{# Determine the badge variant #}
{% if component.status == 'stable' %}
{% set badgeVariant = 'primary' %}
{% elseif component.status == 'experimental' %}
{% set badgeVariant = 'warning' %}
{% elseif component.status == 'planned' %}
{% set badgeVariant = 'neutral' %}
{% elseif component.status == 'deprecated' %}
{% set badgeVariant = 'danger' %}
{% else %}
{% set badgeVariant = 'neutral' %}
{% endif %}
{# Header #}
{{ component.name | classNameToComponentName }}
<{{ component.tagName }}> | {{ component.name }}
{% if component.summary %} {{ component.summary | markdownInline | safe }} {% endif %} {% if component.description %}
Name | Description |
---|---|
{% if slot.name %}
{{ slot.name }}
{% else %}
(default)
{% endif %}
|
{{ slot.description | markdownInline | safe }} |
Learn more about using slots.
{% endif %} {# Properties #} {% if component.properties.length %}Name | Description | Reflects | Type | Default |
---|---|---|---|---|
{{ prop.name }}
{% if prop.attribute != prop.name %}
{{ prop.attribute }}
|
{{ prop.description | markdownInline | safe }}
{% if prop.deprecated %}
{{ prop.deprecated }} {% endif %} |
{% if prop.reflects %}
|
{% if prop.type.text %}
{{ prop.type.text | markdownInline | safe }}
{% else %}
-
{% endif %}
|
{% if prop.default %}
{{ prop.default | markdownInline | safe }}
{% else %}
-
{% endif %}
|
updateComplete |
A read-only promise that resolves when the component has finished updating. |
Learn more about attributes and properties.
{% endif %} {# Events #} {% if component.events.length %}Name | React Event | Description | Event Detail |
---|---|---|---|
{{ event.name }} |
{% if event.description %} {{ event.description | markdownInline | safe }} {% else %} EVENT NEEDS A DESCRIPTION {% endif %} |
{% if event.type.text %}
{{ event.type.text }}
{% else %}
-
{% endif %}
|
Learn more about events.
{% endif %} {# Methods #} {% if component.methods.length %}Name | Description | Arguments |
---|---|---|
{{ method.name }}()
|
{{ method.description | markdownInline | safe }}
{% if method.deprecated %}
{{ method.deprecated | markdownInline | safe }} {% endif %} |
{% if method.parameters.length %}
{% for param in method.parameters %}
{{ param.name }}: {{ param.type.text }}{% if not loop.last %},{% endif %}
{% endfor %}
{% else %}
-
{% endif %}
|
Learn more about methods.
{% endif %} {# Custom Properties #} {% if component.cssProperties.length %}Name | Description | Default |
---|---|---|
{{ cssProperty.name }} |
{{ cssProperty.description | markdownInline | safe }} | {{ cssProperty.default }} |
Learn more about customizing CSS custom properties.
{% endif %} {# CSS Parts #} {% if component.cssParts.length %}Name | Description |
---|---|
{{ cssPart.name }} |
{{ cssPart.description | markdownInline | safe }} |
Learn more about customizing CSS parts.
{% endif %} {# Animations #} {% if component.animations.length %}Name | Description |
---|---|
{{ animation.name }} |
{{ animation.description | markdownInline | safe }} |
Learn more about customizing animations.
{% endif %} {# Dependencies #} {% if component.dependencies.length %}This component automatically imports the following dependencies.
<{{ dependency }}>