Menu
render Input.new(type: :email, placeholder: "Enter your email address")
Add the component to your project
Run the following command in your terminal
bundle exec essence add input
Copy and paste the following code into your project
# frozen_string_literal: true
class Components::Input < Components::Essence
BASE = "flex px-4 h-10 md:h-12 rounded-sm border border-gray-200/80 focus:outline-none focus:ring-offset-2 focus-visible:ring-2"
def initialize(**attributes)
super(**attributes)
end
def view_template(&)
input(**attributes)
end
private
def initialize_merged_classes = merge_classes([ BASE, attributes[:class] ])
end