The personal finance app for everyone (by everyone)
Ruby
<%# locals: (category:) %>
<% category ||= Category.uncategorized %>
<%# Canonical category badge: DS::Pill in badge mode carrying the category's
user-chosen hex (custom_color is the sanctioned escape hatch for hues that
are data, not design). truncate + this min-w-0 wrapper keep long names
ellipsizing inside tight columns (e.g. the transaction row's category
cell) instead of overflowing them. %>
<div class="min-w-0">
<%= render DS::Pill.new(
label: category.display_name,
custom_color: category.color,
icon: category.lucide_icon.presence,
icon_size: "sm",
marker: false,
size: :md,
truncate: true,
label_testid: "category-name",
title: category.display_name) %>
</div>