Sha256: 56450362ed0e0866301b0d79d93ec9cb544aceff67b313073a8d7dcb510ecb0a
Contents?: true
Size: 1.06 KB
Versions: 7
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true module Primer # @label LinkComponent class LinkComponentPreview < ViewComponent::Preview # @label Default Options # # @param underline [Boolean] # @param muted [Boolean] # @param tag [Symbol] select [a, span] # @param scheme [Symbol] select [default, primary, secondary] def default(tag: :a, scheme: :default, muted: false, underline: true) render(Primer::LinkComponent.new(href: "#", tag: tag, scheme: scheme, muted: muted, underline: underline)) { "This is a link!" } end # @label with Tooltip # # @param underline [Boolean] # @param muted [Boolean] # @param tag [Symbol] select [a, span] # @param scheme [Symbol] select [default, primary, secondary] def tooltip(tag: :a, scheme: :default, muted: false, underline: true) render(Primer::LinkComponent.new(href: "#", id: "tooltip-link", tag: tag, scheme: scheme, muted: muted, underline: underline)) do |component| component.with_tooltip(text: "Tooltip text") "Link with tooltip" end end end end
Version data entries
7 entries across 7 versions & 1 rubygems