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 @@ -12,6 +12,7 @@ import BenefitsList from "../components/benefits-list/benefits-list.astro";
1212import BenefitItem from " ../components/benefits-list/benefit-item.astro" ;
1313import { Note } from " ../components/note" ;
1414import { SponsorTiers } from " ../components/sponsor-tiers" ;
15+ import Accordion from " ../components/accordion/accordion.astro" ;
1516
1617export async function getStaticPaths() {
1718 const posts = await getCollection (" pages" );
@@ -44,6 +45,7 @@ const description = post.data.subtitle;
4445 Note ,
4546 SponsorTiers ,
4647 hr: Separator ,
48+ Accordion
4749 }}
4850 />
4951 </Prose >
You can’t perform that action at this time.
0 commit comments