Skip to content

Commit

Permalink
Add a storybook arg for show
Browse files Browse the repository at this point in the history
  • Loading branch information
maxatdetroit committed Jul 29, 2024
1 parent de6199a commit 6b54af2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/stories/articlecard.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export default {
description: 'The subtitle of the article. Custom markdown is supported.',
},
color: COMMON_STORY_ARGS.bootstrapColor,
show: {
control: { type: 'boolean' },
description: 'Toggle to show or hide the article card title text.',
},
},
args: {
src: 'https://placehold.co/300x400',
Expand All @@ -36,6 +40,7 @@ export default {
color: 'primary',
href: 'https://www.example.com',
target: '_blank',
show: false,
},
};

Expand All @@ -57,6 +62,9 @@ function _createArticleCard(args) {
articleCardElt1.setAttribute('color', args.color);
articleCardElt1.setAttribute('href', args.href);
articleCardElt1.setAttribute('target', args.target);
if (args.show) {
articleCardElt1.setAttribute('show', 'show');
}
if (_containsHTMLTags(args.title)) {
const title = _createElementFromHTML(args.title);
title.slot = 'title';
Expand Down

0 comments on commit 6b54af2

Please sign in to comment.