Class: RubyUI::EmptyState
- Defined in:
- lib/generators/ruby_cms/templates/components/ruby_ui/empty_state/empty_state.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(title: "No items yet", description: nil, icon: nil, primary_label: nil, primary_href: nil, primary_method: :get, primary_variant: :primary, secondary_label: nil, secondary_href: nil, secondary_method: :get, secondary_variant: :outline, learn_more_label: nil, learn_more_href: nil, centered: true, **user_attrs) ⇒ EmptyState
constructor
A new instance of EmptyState.
- #view_template ⇒ Object
Constructor Details
#initialize(title: "No items yet", description: nil, icon: nil, primary_label: nil, primary_href: nil, primary_method: :get, primary_variant: :primary, secondary_label: nil, secondary_href: nil, secondary_method: :get, secondary_variant: :outline, learn_more_label: nil, learn_more_href: nil, centered: true, **user_attrs) ⇒ EmptyState
Returns a new instance of EmptyState.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/generators/ruby_cms/templates/components/ruby_ui/empty_state/empty_state.rb', line 5 def initialize( title: "No items yet", description: nil, icon: nil, primary_label: nil, primary_href: nil, primary_method: :get, primary_variant: :primary, secondary_label: nil, secondary_href: nil, secondary_method: :get, secondary_variant: :outline, learn_more_label: nil, learn_more_href: nil, centered: true, **user_attrs ) @title = title @description = description @icon = icon @primary_label = primary_label @primary_href = primary_href @primary_method = primary_method @primary_variant = primary_variant @secondary_label = secondary_label @secondary_href = secondary_href @secondary_method = secondary_method @secondary_variant = secondary_variant @learn_more_label = learn_more_label @learn_more_href = learn_more_href @centered = centered super(**user_attrs) end |
Instance Method Details
#view_template ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/generators/ruby_cms/templates/components/ruby_ui/empty_state/empty_state.rb', line 39 def view_template div(**attrs) do content_wrapper do render_icon h2(class: title_classes) { @title } p(class: "mt-2 text-sm text-muted-foreground") { @description } if @description render_actions render_learn_more end end end |