defmodule TrackerWeb.SectionHeader do @moduledoc """ The heading above a `TrackerWeb.RowList` — a small uppercase title, a hairline rule filling the width the title leaves, and the number of rows in the list underneath. Affordances for the list — a filter form, a toggle — go in `:controls`, which shares the header's line with the title and drops to a line of its own on a narrow screen. """ use Phoenix.Component @doc """ Renders the header. ## Examples ... """ attr :title, :string, required: true attr :count, :integer, default: nil attr :class, :string, default: nil slot :controls, doc: "affordances for the list — a filter form, a toggle, a link" def section_header(assigns) do ~H"""

{@title}

{render_slot(@controls)} {@count}
""" end end