ToggleSwitch.hpp

Wraps Bootstrap’s toggle switch.

class ToggleSwitch : public Element
#include <ToggleSwitch.hpp>

Public Functions

inline ToggleSwitch(const std::function<void(std::string)> &cb, const std::string &label, const bool is_checked = false, const std::string &t_switch_id = "")
Parameters:
  • cb – callback function passed onto input constructor

  • label – text for switch label

  • is_checked – is the switched defaulted to on?

  • t_switch_id – the id to assign the html object for this switch

template<typename T>
inline void AddLabel(const T usr_label)

Add label to switch after constructor.

Private Members

Element label_element = {to_string("label")}