Label

I wish there was a way to label my inputs...

bin/rails g quicksilver_ui:form Label

Default

  • With overriden text

  • Implementation

    # frozen_string_literal: true
    
    class Form::Label < Form::BaseTag
      prop :text, _Nilable(String), reader: :private
    
      def view_template
        label(class: classes, **options_with_defaults) { text || method }
      end
    
      private
    
      def default_classes
        "ui-form-label"
      end
    
      def default_options
        {for: id}
      end
    end