From 63a15c888dcaa061d6ae7a0a35369b3cc1183363 Mon Sep 17 00:00:00 2001 From: Mathias Polligkeit Date: Mon, 1 Jan 2024 16:24:34 +0900 Subject: [PATCH] allow setting tabs heading level --- lib/doggo.ex | 7 ++++++- test/doggo_test.exs | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/doggo.ex b/lib/doggo.ex index 380eec1b..abe5322d 100644 --- a/lib/doggo.ex +++ b/lib/doggo.ex @@ -3891,6 +3891,11 @@ defmodule Doggo do attr :id, :string, required: true attr :title, :string, required: true, doc: "A title that labels the tabs." + attr :heading, :string, + default: "h3", + values: ["h2", "h3", "h4", "h5", "h6"], + doc: "The heading level." + attr :class, :any, default: [], doc: "Additional CSS classes. Can be a string or a list of strings." @@ -3904,7 +3909,7 @@ defmodule Doggo do def tabs(assigns) do ~H"""
-

<%= @title %>

+ <.dynamic_tag name={@heading} id={"#{@id}-title"}><%= @title %>