BasicCheckedCheckboxComponent

InfoGeneratePackages

This code defines a Ruby class named CheckboxComponent that inherits from a superclass named ApplicationComponent. Its primary function is to generate a template for a checkbox input element. The template is created within the "template" instance method, which returns an HTML input element of type "checkbox" that is already checked. The input element is assigned a default CSS class of "checkbox," but the class does not implement customization options for color or size despite comments suggesting such capabilities.

# frozen_string_literal: true

# Checkbox can be modified by:
# color: checkbox-primary, checkbox-secondary, checkbox-accent, checkbox-success, checkbox-warning, checkbox-info, checkbox-error
# size: checkbox-lg, checkbox-md, checkbox-sm, checkbox-xs

class CheckboxComponent < ApplicationComponent
  def template
    input(type: "checkbox", checked: "checked", class: "checkbox")
  end
end