rx/presenters

View on GitHub
app/demo/components/tab_bars.pom

Summary

Maintainability
Test Coverage
require_relative '../helpers/indented_grid'

Voom::Presenters.define(:tab_bars) do
  helpers Demo::Helpers::IndentedGrid
  attach :top_nav
  attach :component_drawer
  page_title 'Tab Bars'

  indented_grid do

    title 'Standard Tab Bar'
    tab_bar do
      tab 'One', selected: true
      tab 'Two'
      tab 'Three'
    end
    separator

    title 'Tabs with icons next to labels'
    tab_bar do
      tab 'One', icon: :thumb_up
      tab 'Two', icon: :face, selected: true
      tab 'Three', icon: :thumb_down
    end
    separator

    title 'Tabs with icons above labels'
    tab_bar do
      tab 'One', icon: :thumb_up, stacked: true, selected: true
      tab 'Two', icon: :face, stacked: true
      tab 'Three', icon: :thumb_down, stacked: true
    end
    separator

    title 'Scrolling Tabs'
    tab_bar do
      15.times do |idx|
        tab "Tab Number-#{idx}", selected: idx == 3 do
          event :click do
            snackbar 'tab clicked'
          end
        end
      end
    end
    separator

    title 'Content is automatically displayed/hidden'
    tab_bar do
      tab 'One', selected: true do
        heading3 'Tab 1'
      end
      tab 'Two' do
        heading3 'Tab 2'
      end
      tab 'Three' do
        heading3 'Tab 3'
      end
    end

  end

  attach :code, file: __FILE__
end