Class: Primer::BlankslateComponent
- Defined in:
- app/components/primer/blankslate_component.rb
Overview
Use Primer::BlankslateComponent when there is a lack of content within a page or section. Use as placeholder to tell users why something isn’t there.
Constant Summary
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(title: "", title_tag: :h3, icon: "", icon_size: :medium, image_src: "", image_alt: " ", description: "", button_text: "", button_url: "", button_classes: "btn-primary my-3", link_text: "", link_url: "", narrow: false, large: false, spacious: false, **system_arguments) ⇒ BlankslateComponent
constructor
A new instance of BlankslateComponent.
Methods included from FetchOrFallbackHelper
Methods included from ClassNameHelper
Constructor Details
#initialize(title: "", title_tag: :h3, icon: "", icon_size: :medium, image_src: "", image_alt: " ", description: "", button_text: "", button_url: "", button_classes: "btn-primary my-3", link_text: "", link_url: "", narrow: false, large: false, spacious: false, **system_arguments) ⇒ BlankslateComponent
Returns a new instance of BlankslateComponent.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'app/components/primer/blankslate_component.rb', line 71 def initialize( title: "", title_tag: :h3, icon: "", icon_size: :medium, image_src: "", image_alt: " ", description: "", button_text: "", button_url: "", button_classes: "btn-primary my-3", link_text: "", link_url: "", #variations narrow: false, large: false, spacious: false, **system_arguments ) @system_arguments = system_arguments @system_arguments[:tag] ||= :div @system_arguments[:classes] = class_names( @system_arguments[:classes], "blankslate", "blankslate-narrow": narrow, "blankslate-large": large, "blankslate-spacious": spacious, ) @title_tag = title_tag @icon = icon @icon_size = icon_size @image_src = image_src @image_alt = image_alt @title = title @description = description = = = @link_text = link_text @link_url = link_url end |