{% 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 }}
Since {{component.since or '?' }} {{ component.status }}

{% if component.summary %} {{ component.summary | markdownInline | safe }} {% endif %} {% if component.description %}

Overview

{{ component.description | markdown | safe}} {% endif %}

{# Markdown content #} {% if component.content %} {{ component.content | markdown | safe }} {% endif %} {# Slots #} {% if component.slots.length %}

Slots

{% for slot in component.slots %} {% endfor %}
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 %}

Properties

{% for prop in component.properties %} {% endfor %}
Name Description Reflects Type Default
{{ prop.name }} {% if prop.attribute != prop.name %}
{{ prop.attribute }} {% endif %}
{{ prop.description | markdownInline | safe }} {% if prop.deprecated %}
{{ prop.deprecated }} {% endif %}
{% if prop.reflects %} {% endif %} {% 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 %}

Events

{% for event in component.events %} {% endfor %}
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 %}

Methods

{% for method in component.methods %} {% endfor %}
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 %}

Custom Properties

{% for cssProperty in component.cssProperties %} {% endfor %}
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 %}

Parts

{% for cssPart in component.cssParts %} {% endfor %}
Name Description
{{ cssPart.name }} {{ cssPart.description | markdownInline | safe }}

Learn more about customizing CSS parts.

{% endif %} {# Animations #} {% if component.animations.length %}

Animations

{% for animation in component.animations %} {% endfor %}
Name Description
{{ animation.name }} {{ animation.description | markdownInline | safe }}

Learn more about customizing animations.

{% endif %} {# Dependencies #} {% if component.dependencies.length %}

Dependencies

This component automatically imports the following dependencies.

{% endif %} {% else %} This component is not correctly documented {% endif %} {% endblock %}