class NfgUi::Components::Patterns::Carousel
Carousel
doesn't have any customizations unique to the design system yet As such, the NFG UI
carousel is simply a bootstrap carousel behind the scenes. Traits
will eventually be connected here.
Public Instance Methods
render() { |: body))| ... }
click to toggle source
# File lib/nfg_ui/components/patterns/carousel.rb, line 14 def render content_tag(:div, html_options) do content_tag(:div, class: carousel_inner_css_classes) do concat((block_given? ? yield : body)) if controls concat(NfgUi::Components::Elements::CarouselControl.new({ control: :next, carousel: "##{id}" }, view_context).render) concat(NfgUi::Components::Elements::CarouselControl.new({ control: :prev, carousel: "##{id}" }, view_context).render) end if indicators > 0 concat(NfgUi::Components::Elements::CarouselIndicators.new({ count: indicators, carousel: "##{id}" }, view_context).render) end end end end
Private Instance Methods
carousel_inner_css_classes()
click to toggle source
# File lib/nfg_ui/components/patterns/carousel.rb, line 31 def carousel_inner_css_classes [ 'carousel-inner', ('pb-3' if indicators > 0) ].join(' ').squish end