Class: Primer::TextComponent
- Defined in:
- app/components/primer/text_component.rb
Overview
The Text component is a wrapper component that will apply typography styles to the text inside.
Constant Summary
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
Primer::TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**system_arguments) ⇒ TextComponent
constructor
A new instance of TextComponent.
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Constructor Details
#initialize(**system_arguments) ⇒ TextComponent
Returns a new instance of TextComponent.
13 14 15 16 |
# File 'app/components/primer/text_component.rb', line 13 def initialize(**system_arguments) @system_arguments = system_arguments @system_arguments[:tag] ||= :span end |
Instance Method Details
#call ⇒ Object
18 19 20 |
# File 'app/components/primer/text_component.rb', line 18 def call render(Primer::BaseComponent.new(**@system_arguments)) { content } end |