Skip to content

Commit 062d9f9

Browse files
authored
Allow customizing tag_name for deck object (#1804)
1 parent e681420 commit 062d9f9

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.changeset/cyan-pots-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudfour/patterns': minor
3+
---
4+
5+
Allow passing `tag_name` to deck object

src/objects/deck/deck.stories.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ const alignmentClasses = {
7676
type: { name: 'string' },
7777
control: { type: 'inline-radio' },
7878
},
79+
tag_name: {
80+
type: { name: 'string' },
81+
description: 'The root tag for the component',
82+
table: {
83+
defaultValue: {
84+
summary: 'div',
85+
},
86+
},
87+
},
7988
}}
8089
/>
8190

src/objects/deck/deck.twig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
<div class="o-deck{% if class %} {{ class }}{% endif %}">
1+
{% set tag_name = tag_name|default('div') %}
2+
3+
<{{ tag_name }} class="o-deck{% if class %} {{ class }}{% endif %}">
24
{% block content %}{% endblock %}
3-
</div>
5+
</{{ tag_name }}>

0 commit comments

Comments
 (0)