FAQ
An accessible accordion of questions and answers.
Give your AI assistant this page as context.
Connect your library with MCPLoading Vue preview…
blocks/faqUsage
Choose Vue in the Studio and export your saved library, or install this item through its connected CLI/MCP. Vue setup and Nuxt integration.
<script setup lang="ts">
import FaqBlock from './components/blocks/faq.vue'
</script>
<!-- Supply the required props and callbacks listed in Source and props. -->Design system
This Vue component consumes the same CodeRocket tokens as the React version. Import the compiled styles and wrap your app in ThemeScope. Tailwind is optional.
Behavior and accessibility
Vue uses native events, v-model and slots. Reka UI handles keyboard and focus behavior in complex primitives. Connect actions to your own application and review labels, contrast and mobile behavior in context. Components are experimental during early access.
The full ZIP also includes examples/block-showcase.vue, with populated block props, illustrations and local sample callbacks to adapt to your application.
Source and props
This is the exact Vue single-file component delivered by the export. Related helpers and dependencies are included automatically.
<script setup lang="ts">
import { computed } from "vue";
import { ArrowUpRight } from "@lucide/vue";
import Accordion from "../ui/accordion.vue";
import type { DisplayContent } from "../ui/display-types";
import { RenderContent } from "../ui/display-utils";
import MarketingHeading from "./marketing-heading.vue";
const props = defineProps<{
title: string;
eyebrow?: string;
description?: string;
contact?: { label: string; href: string };
items: readonly { question: string; answer: DisplayContent }[];
}>();
const accordionItems = computed(() =>
props.items.map((item, index) => ({
value: String(index),
title: item.question,
content: item.answer,
})),
);
</script>
<template>
<section class="cr-marketing-section cr-faq-section">
<div class="cr-faq-layout">
<div class="cr-faq-intro">
<MarketingHeading
:title="title"
:description="description"
:eyebrow="eyebrow"
/><a v-if="contact" class="cr-feature-link" :href="contact.href"
>{{ contact.label
}}<ArrowUpRight :size="16" :stroke-width="1.75" aria-hidden="true"
/></a>
</div>
<div class="cr-faq-content">
<Accordion :items="accordionItems"
><template #content="{ item }"
><slot
name="answer"
:item="items[Number(item.value)]"
:index="Number(item.value)"
><RenderContent :content="item.content" /></slot></template
></Accordion>
</div>
</div>
</section>
</template>