@wikicasa-dev/components · Layout · primitive

AccordionTriggerPrimitive

Unstyled button that opens and closes a primitive accordion item.

Unstyled button that opens and closes a primitive accordion item.

import AccordionTriggerPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionTriggerPrimitive";

Part of the primitive accordion composition: see the AccordionItemPrimitive doc for the full example. Place it inside AccordionHeaderPrimitive. It renders a <button> with aria-expanded/aria-controls and keyboard support already wired.

Usage

<script setup lang="ts">
import AccordionTriggerPrimitive from "@wikicasa-dev/components/UIKit/Accordion/AccordionTriggerPrimitive";
</script>

<template>
  <!-- inside <AccordionHeaderPrimitive> -->
  <AccordionTriggerPrimitive class="faq-trigger" data-cy="faq-trigger">
    Quanto costa pubblicare un annuncio?
  </AccordionTriggerPrimitive>
</template>

Do / Don't

  • It is already a button: don't nest <button> or links inside it.
  • It has no UIKit styling at all: give it your own class for background, border, width and alignment.
  • Style the open state with [data-state="open"].

API

Generated from the component's types. Do not edit by hand.

Props

Name Type Default Required Description
asChild boolean Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as AsTag | Component The element or component this component should render as. Can be overwritten by asChild.
dataCy string

Events

None.

v-model

None.

Slots

Name Slot props
default

Exposed (template ref)

None.