{% extends "default.njk" %}
{# Find the component based on the `tag` front matter #}
{% set component = getComponent('sl-' + page.fileSlug) %}
{% block content %}
{# 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 %}
{# Markdown content #} {{ content | safe }} {# Importing #}If you're using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.
To import this component from the CDN using a script tag:
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@{{ meta.version }}/{{ meta.cdndir }}/{{ component.path }}"></script>
To import this component from the CDN using a JavaScript import:
import 'https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@{{ meta.version }}/{{ meta.cdndir }}/{{ component.path }}';
To import this component using a bundler:
import '@shoelace-style/shoelace/{{ meta.npmdir }}/{{ component.path }}';
To import this component as a React component:
import { {{ component.name }} } from '@shoelace-style/shoelace/{{ meta.npmdir }}/react';
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.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 }} |
{{ event.reactName }} |
{{ event.description | markdownInline | safe }} |
{% 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.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 }}>