Build app-specific blocks the same way: a ViewComponent (subclassing Componeer::BaseComponent gives you html_attributes, icon_svg and option!) whose template uses Componeer helpers. Keep the markup in the template and the logic in the class. Register it in an initializer and call it like any built-in.
A name that would override an Action View helper (select, label, search_field…) is refused at boot.
# app/components/quest_card_component.rb
class QuestCardComponent < Componeer::BaseComponent
def initialize(quest:)
@quest = quest
end
end
<%# app/components/quest_card_component.html.erb %>
<%= card(title: @quest.title, subtitle: @quest.project.name) do |c| %>
<% c.with_action { status_pill @quest.status_label, status: :accent } %>
<%= content %>
<% end %>
# config/initializers/componeer.rb
Componeer.register :quest_card, "QuestCardComponent"
<%# any view %>
<%= quest_card(quest: @quest) do %>
<%= render @quest.missions %>
<% end %>
Extra icons
Point Componeer at folders of your own SVGs. They are looked up before the bundled Tabler set, so icon "logo" finds app/assets/icons/logo.svg.
Componeer.configure do |config|
config.icon_paths << Rails.root.join("app/assets/icons")
end