defmodule PetalComponents.Breadcrumbs do use Phoenix.Component alias PetalComponents.Link attr(:separator, :string, default: "slash", values: ["slash", "chevron"]) attr(:class, :string, default: "", doc: "Parent div CSS class") attr(:separator_class, :string, default: "", doc: "Separator div CSS class") attr(:link_class, :string, default: "", doc: "Link class CSS") attr(:links, :list, default: [], doc: "List of your links") attr(:rest, :global) # Example: # <.breadcrumbs separator="chevron" # class="mt-3" # link_class="!text-blue-500 text-sm font-semibold" # links={[ # %{ label: "Link 1", to: "/" }, # %{ label: "Link 1", to: "/", link_type: "patch|a|redirect" } # ]} # /> def breadcrumbs(assigns) do ~H"""