File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ export interface Props {
3+ title: string ;
4+ id: string ;
5+ }
6+
7+ const { title, id } = Astro .props ;
8+ ---
9+
10+ <details class =" group mb-4" >
11+ <summary
12+ aria-expanded =" false"
13+ aria-controls ={ id }
14+ class =" cursor-pointer flex justify-between p-2 rounded-md border-t border-b focus:ring-2"
15+ >
16+ <span class =" font-semibold" >{ title } </span >
17+ <span aria-hidden =" true" class =" group-open:hidden" >+</span >
18+ <span aria-hidden =" true" class =" group-open:block hidden" >−</span >
19+ </summary >
20+
21+ <div id ={ id } class =" pl-4" >
22+ <slot />
23+ </div >
24+ </details >
Original file line number Diff line number Diff line change @@ -270,3 +270,22 @@ Barking up the right tree
270270
271271## YouTube
272272<YouTube id = " j5a0jTc9S10" alt = " Mood lifter" />
273+
274+ ## Accordion
275+ #### What do the dogs say?
276+
277+ <Accordion title = " Spanish-speaking dogs" id = " spanish" >
278+ ** Guau guau!**
279+ </Accordion >
280+
281+ <Accordion title = " Italian-speaking dogs" id = " italian" >
282+ * Bau bau!*
283+ </Accordion >
284+
285+ <Accordion title = " Japanese-speaking dogs" id = " japanese" >
286+ ワンワン
287+ </Accordion >
288+
289+ <Accordion title = " Finnish-speaking dogs" id = " finnish" >
290+ *** Hau hau!***
291+ </Accordion >
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import HighlightCard from "../components/highlight-list/highlight-card.astro";
1414import HighlightItem from " ../components/highlight-list/highlight-item.astro" ;
1515import { Note } from " ../components/note" ;
1616import SponsorTiers from " ../components/sponsor-tiers/sponsor-tiers.astro" ;
17+ import Accordion from " ../components/accordion/accordion.astro" ;
1718
1819export async function getStaticPaths() {
1920 const posts = await getCollection (" pages" );
@@ -48,6 +49,7 @@ const description = post.data.subtitle;
4849 Note ,
4950 SponsorTiers ,
5051 hr: Separator ,
52+ Accordion
5153 }}
5254 />
5355 </Prose >
You can’t perform that action at this time.
0 commit comments