Sha256: 6d4e019ef87e83ab6346e3b9028959e004959273600eea3f6252ba9d3641c541
Contents?: true
Size: 747 Bytes
Versions: 10
Compression:
Stored size: 747 Bytes
Contents
# frozen_string_literal: true module Primer # Use the Heading component to wrap a component that will create a heading element class HeadingComponent < Primer::Component status :beta # @example Default # <%= render(Primer::HeadingComponent.new) { "H1 Text" } %> # <%= render(Primer::HeadingComponent.new(tag: :h2)) { "H2 Text" } %> # <%= render(Primer::HeadingComponent.new(tag: :h3)) { "H3 Text" } %> # # @param system_arguments [Hash] <%= link_to_system_arguments_docs %> def initialize(**system_arguments) @system_arguments = system_arguments @system_arguments[:tag] ||= :h1 end def call render(Primer::BaseComponent.new(**@system_arguments)) { content } end end end
Version data entries
10 entries across 10 versions & 1 rubygems