Skip to content

Commit

Permalink
Merge branch 'main' into lw/announce-on-clipboard-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
lindseywild authored May 16, 2024
2 parents c52456f + 1a204c8 commit 59e8e0a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions previews/primer/beta/label_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ class LabelPreview < ViewComponent::Preview
# @param size [Symbol] select [medium, large]
# @param tag [Symbol] select [span, summary, a, div]
# @param inline [Boolean] toggle
def playground(size: :medium, tag: :span, inline: false)
render(Primer::Beta::Label.new(tag: tag, size: size, inline: inline)) { "Label" }
# @param href [String] URL to be used with an anchor tag
def playground(size: :medium, tag: :span, inline: false, href: nil)
if tag == :a
render(Primer::Beta::Label.new(tag: tag, size: size, inline: inline, href: href || "#")) { "Link label" }
else
render(Primer::Beta::Label.new(tag: tag, size: size, inline: inline)) { "Label" }
end
end

# @label Default Options
Expand Down

0 comments on commit 59e8e0a

Please sign in to comment.