Class: SwitchPreview

Inherits:
Lookbook::Preview
  • Object
show all
Defined in:
lib/lookbook/switch_preview.rb

Instance Method Summary collapse

Instance Method Details

#default(label: 'Switch', disabled: false, required: false, true_label: nil, false_label: nil) ⇒ Object

Parameters:

  • label (defaults to: 'Switch')

    text

  • true_label (defaults to: nil)

    text

  • false_label (defaults to: nil)

    text

  • disabled (defaults to: false)

    toggle



7
8
9
# File 'lib/lookbook/switch_preview.rb', line 7

def default(label: 'Switch', disabled: false, required: false, true_label: nil, false_label: nil)
  render 'common/form', helper_name: 'material_switch', label: label, name: 'checkbox', id: 'Input', disabled: disabled, true_label: true_label, false_label: false_label
end