Sha256: c38e115f10a435f3e4c53b62632e5d64a636e9cffd5d0e6a72cc1cab90133c88
Contents?: true
Size: 1.18 KB
Versions: 5
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true module Primer # Use links for moving from one page to another. The Link component styles anchor tags with default blue styling and hover text-decoration. class LinkComponent < Primer::Component # @example Default # <%= render(Primer::LinkComponent.new(href: "http://www.google.com")) { "Link" } %> # # @example Muted # <%= render(Primer::LinkComponent.new(href: "http://www.google.com", muted: true)) { "Link" } %> # # @param href [String] URL to be used for the Link # @param muted [Boolean] Uses light gray for Link color, and blue on hover # @param system_arguments [Hash] <%= link_to_system_arguments_docs %> def initialize(href:, muted: false, **system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = :a @system_arguments[:href] = href @system_arguments[:classes] = class_names( @system_arguments[:classes], "muted-link" => fetch_or_fallback_boolean(muted, false) ) end def call render(Primer::BaseComponent.new(**@system_arguments)) { content } end def self.status Primer::Component::STATUSES[:beta] end end end
Version data entries
5 entries across 5 versions & 1 rubygems