Class: NfgUi::Components::Patterns::Card

Inherits:
Bootstrap::Components::Card show all
Includes:
Traits::Theme, Utilities::Describable, Utilities::Renderable, Utilities::Traitable
Defined in:
lib/nfg_ui/components/patterns/card.rb

Overview

Card doesn’t have any customizations unique to the design system yet As such, the NFG UI card is simply a bootstrap card behind the scenes. Traits will eventually be connected here.

Constant Summary

Constants included from Traits::Theme

Traits::Theme::COLOR_TRAITS, Traits::Theme::TRAITS

Constants included from Traits

Traits::REGISTERED_TRAITS, Traits::TRAIT_MODULES

Instance Attribute Summary

Attributes inherited from Bootstrap::Components::Base

#body, #options, #view_context

Instance Method Summary collapse

Methods included from Traits::Theme

#danger_trait, #dark_trait, #info_trait, #light_trait, #outlined_trait, #primary_trait, #secondary_trait, #success_trait, #warning_trait, #white_trait

Methods included from Utilities::Renderable

#render_if, #render_unless

Methods included from Utilities::Describable

#data, #describe

Methods included from Utilities::Traitable

#traits, #utility_initialize

Methods inherited from Bootstrap::Components::Card

#component_family, #footer, #heading, #subtitle, #title

Methods included from Bootstrap::Utilities::Themeable

#outlined, #theme

Methods inherited from Bootstrap::Components::Base

#component_family, #data, #href, #html_options, #id, #initialize, #style

Constructor Details

This class inherits a constructor from NfgUi::Bootstrap::Components::Base

Instance Method Details

#renderObject

TODO: Confirm that the image overlays are correct. The tops are not being rounded. Should they be?



17
18
19
20
21
22
23
24
25
# File 'lib/nfg_ui/components/patterns/card.rb', line 17

def render
  if render_in_body
    super
  else
    (:div, html_options) do
      body
    end
  end
end

#render_in_bodyObject



27
28
29
# File 'lib/nfg_ui/components/patterns/card.rb', line 27

def render_in_body
  options.fetch(:render_in_body, true)
end