Merge pull request #2770 from alxhslm/accordion-icon

Feat: add icon param to accordian
This commit is contained in:
Nuno C.
2026-02-11 21:46:36 +00:00
committed by GitHub
2 changed files with 10 additions and 3 deletions
+7 -1
View File
@@ -6,6 +6,7 @@
{{ $isSeparated := or (eq $separated true) (eq $separated "true") }}
{{ $title := .Get "title" | default (.Get "header") }}
{{ $icon := .Get "icon" }}
{{ $md := .Get "md" | default true }}
{{ $open := .Get "open" | default false }}
{{ $isOpen := or (eq $open true) (eq $open "true") }}
@@ -16,7 +17,12 @@
{{ if $isOpen }}open{{ end }}
>
<summary class="flex w-full cursor-pointer items-center justify-between gap-4 px-4 py-3 text-left text-lg font-semibold text-neutral-900 dark:text-neutral-100">
<span>{{ $title }}</span>
<span class="flex items-center gap-2">
{{ with $icon }}
{{ partial "icon.html" . }}
{{ end }}
<span>{{ $title }}</span>
</span>
<span>
{{ partial "icon" "chevron-down" }}
</span>