Markdown docs
Tag
This is Twig implementation of the Tag component.
Basic example usage:
<Tag>Tag</Tag>
Advanced example usage:
<Tag color="success" elementType="div" size="small" isSubtle>Tag content</Tag>
Without lexer:
{% embed "@spirit/tag.twig" with { props: {
color: 'success',
elementType: 'div'
size: 'small',
isSubtle: 'true'
}} %}
{% block content %}
Tag content
{% endblock %}
{% endembed %}
API
Name | Type | Default | Required | Description |
---|---|---|---|---|
color | Emotion Color dictionary, neutral | neutral | ✕ | Color of the component |
elementType | string | span | ✕ | HTML tag to render |
isSubtle | bool | false | ✕ | Whether the Tag is displayed in subtle variant |
size | Size Extended dictionary | medium | ✕ | Size of the Tag |
On top of the API options, the components accept additional attributes. If you need more control over the styling of a component, you can use style props and escape hatches.