Method: Primer::Alpha::SegmentedControl#render?
- Defined in:
- app/components/primer/alpha/segmented_control.rb
#render? ⇒ Boolean
62 63 64 65 66 67 |
# File 'app/components/primer/alpha/segmented_control.rb', line 62 def render? valid_items_count = items.count <= (@hide_labels ? 6 : 5) && items.count >= 2 raise ArgumentError, "A segmented control should have 2–5 choices with text labels, or up to 6 icon-only buttons." if !valid_items_count && !Rails.env.production? valid_items_count end |