Collapsible sections built on native details and summary, no JavaScript needed.
How long does shipping take?
Which payment methods are available?
How do I return an item?
How long does shipping take?
Which payment methods are available?
How do I return an item?
How long does shipping take?
Which payment methods are available?
How do I return an item?
How long does shipping take?
Which payment methods are available?
How do I return an item?
How long does shipping take?
Which payment methods are available?
How do I return an item?
<x-markas.accordion :items="['shipping' => 'How long does shipping take?', 'payment' => 'Which payment methods are available?', 'returns' => 'How do I return an item?']" default-value="shipping">
<x-slot:shipping>Orders arrive in 2 to 4 business days.</x-slot:shipping>
<x-slot:payment>Bank transfer, credit card, and digital wallets.</x-slot:payment>
<x-slot:returns>Request a return within 7 days from the order page.</x-slot:returns>
</x-markas.accordion>Examples
Multiple open
Account
Billing
Security
Account
Billing
Security
Account
Billing
Security
Account
Billing
Security
Account
Billing
Security
<x-markas.accordion :items="['account' => 'Account', 'billing' => 'Billing', 'security' => 'Security']" type="multiple" :default-value="['account', 'billing']">
<x-slot:account>Update your name, email, and profile photo.</x-slot:account>
<x-slot:billing>Manage your plan, payment method, and invoices.</x-slot:billing>
<x-slot:security>Turn on two-step verification and review active sessions.</x-slot:security>
</x-markas.accordion>FAQ
Frequently asked questions
Still have questions? Contact our support team.
Is there a free trial?
Can I cancel at any time?
Can I invite my team?
Where is my data stored?
Frequently asked questions
Still have questions? Contact our support team.
Is there a free trial?
Can I cancel at any time?
Can I invite my team?
Where is my data stored?
Frequently asked questions
Still have questions? Contact our support team.
Is there a free trial?
Can I cancel at any time?
Can I invite my team?
Where is my data stored?
Frequently asked questions
Still have questions? Contact our support team.
Is there a free trial?
Can I cancel at any time?
Can I invite my team?
Where is my data stored?
Frequently asked questions
Still have questions? Contact our support team.
Is there a free trial?
Can I cancel at any time?
Can I invite my team?
Where is my data stored?
<div class="grid gap-4">
<div class="grid gap-1">
<h2 class="text-base font-semibold text-ink">Frequently asked questions</h2>
<p class="text-sm text-muted">Still have questions? Contact our support team.</p>
</div>
<x-markas.accordion :items="['trial' => 'Is there a free trial?', 'cancel' => 'Can I cancel at any time?', 'team' => 'Can I invite my team?', 'data' => 'Where is my data stored?']">
<x-slot:trial>Yes. Every plan starts with a 14 day trial, no card required.</x-slot:trial>
<x-slot:cancel>Yes. Your plan stays active until the end of the billing period.</x-slot:cancel>
<x-slot:team>Invite as many members as your plan allows from the team settings.</x-slot:team>
<x-slot:data>Data is stored in Jakarta and backed up every day.</x-slot:data>
</x-markas.accordion>
</div>In a card
Order summary
Shipping address
Payment method
Order summary
Shipping address
Payment method
Order summary
Shipping address
Payment method
Order summary
Shipping address
Payment method
Order summary
Shipping address
Payment method
<x-markas.accordion :items="['order' => 'Order summary', 'shipping' => 'Shipping address', 'payment' => 'Payment method']" default-value="order" class="rounded-xl border bg-surface px-4">
<x-slot:order>3 items, total $86.00 including tax.</x-slot:order>
<x-slot:shipping>Jl. Merdeka No. 12, Bandung, West Java 40111.</x-slot:shipping>
<x-slot:payment>Visa ending in 4242, expires 08/28.</x-slot:payment>
</x-markas.accordion>Rich content
What is included in the Pro plan?
- Up to 10 team members
- 50 GB of storage
- Priority email support
How do I upgrade?
What is included in the Pro plan?
- Up to 10 team members
- 50 GB of storage
- Priority email support
How do I upgrade?
What is included in the Pro plan?
- Up to 10 team members
- 50 GB of storage
- Priority email support
How do I upgrade?
What is included in the Pro plan?
- Up to 10 team members
- 50 GB of storage
- Priority email support
How do I upgrade?
What is included in the Pro plan?
- Up to 10 team members
- 50 GB of storage
- Priority email support
How do I upgrade?
Installation
npx markasui@latest add accordionpnpm dlx markasui@latest add accordionyarn dlx markasui@latest add accordionbunx --bun markasui@latest add accordion- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
resources/views/components/markas/accordion.blade.php.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Accordion.tsx.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Accordion.vue.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/lib/components/markas/Accordion.svelte.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/components/markas/Accordion.astro.
- Make sure Tailwind CSS v4 and markas.css are installed. See Installation.
- Copy the component source below to
src/app/markas/accordion.component.ts.
Usage
<x-markas.accordion :items="['shipping' => 'How long does shipping take?', 'returns' => 'How do I return an item?']" default-value="shipping">
<x-slot:shipping>Orders arrive in 2 to 4 business days.</x-slot:shipping>
<x-slot:returns>Request a return within 7 days from the order page.</x-slot:returns>
</x-markas.accordion>No Alpine.js needed.
import { Accordion } from "@/components/markas/Accordion";
<Accordion
defaultValue="shipping"
items={[
{
value: "shipping",
title: "How long does shipping take?",
content: "Orders arrive in 2 to 4 business days.",
},
{
value: "returns",
title: "How do I return an item?",
content: "Request a return within 7 days from the order page.",
},
]}
/>;<template>
<Accordion
default-value="shipping"
:items="[
{ value: 'shipping', title: 'How long does shipping take?' },
{ value: 'returns', title: 'How do I return an item?' },
]"
>
<template #shipping>Orders arrive in 2 to 4 business days.</template>
<template #returns
>Request a return within 7 days from the order page.</template
>
</Accordion>
</template><script lang="ts">
import Accordion from "$lib/components/markas/Accordion.svelte";
const items = [
{
value: "shipping",
title: "How long does shipping take?",
content: "Orders arrive in 2 to 4 business days.",
},
{ value: "returns", title: "How do I return an item?", content: returns },
];
</script>
{#snippet returns()}
Request a return within 7 days from the <a href="/orders">order page</a>.
{/snippet}
<Accordion {items} defaultValue="shipping" />content takes plain text or a snippet for rich content.
---
import Accordion from "@/components/markas/Accordion.astro";
const items = [
{
value: "shipping",
title: "How long does shipping take?",
content: "Orders arrive in 2 to 4 business days.",
},
{ value: "returns", title: "How do I return an item?" },
];
---
<Accordion items={items} defaultValue="shipping">
<p slot="returns">Request a return within 7 days from the order page.</p>
</Accordion>An item without content renders the slot named after its value. No JavaScript is shipped.
import { Component } from "@angular/core";
import { Accordion } from "./markas/accordion.component";
@Component({
selector: "app-faq",
imports: [Accordion],
template: `
<ng-template #returns>
Request a return within 7 days from the <a href="/orders">order page</a>.
</ng-template>
<markas-accordion
[items]="[
{
value: 'shipping',
title: 'How long does shipping take?',
content: 'Orders arrive in 2 to 4 business days.',
},
{
value: 'returns',
title: 'How do I return an item?',
content: returns,
},
]"
defaultValue="shipping"
/>
`,
})
export class Faq {}content takes plain text or an ng-template reference for rich content.
type="single"(the default) gives everydetailsthe samenameattribute, so the browser closes the other sections natively. Usetype="multiple"to let several sections stay open.- Older browsers without
details[name]support still open sections, they are just not exclusive. - The component has no built-in text. Titles and content come from your own data, so write them in any language.
Props
| Name | Type | Default | Description |
|---|---|---|---|
items | Blade: array<key, title> · React: { value, title, content }[] · Vue: { value, title }[] · Svelte: { value, title, content: string | Snippet }[] · Astro: { value, title, content? }[] · Angular: { value, title, content: string | TemplateRef }[] | [] | Section list. In Blade and Vue, fill each section through a slot named after its key or value. Astro uses the same named slot when an item has no content. Svelte takes a snippet and Angular an ng-template reference for rich content. |
type | 'single' | 'multiple' | 'single' | single: only one section open at a time (shared name attribute on details). multiple: any number open. |
defaultValue | string | string[] | - | Sections open on first render. With type single only the first value is used. |
Accessibility
- Uses native details and summary, so the summary acts as a button with an open or closed state.
- Enter and Space on the summary open and close the section.
- The chevron icon is aria-hidden.
Related components
More navigation components with the same classes in every framework.
- BreadcrumbTrail of the current page's location in the site hierarchy, with the current page marked by aria-current.
- CollapsibleA single section that opens and closes, built on native details and summary without JavaScript. Good for show more content.
- FooterSite footer with six layouts: link columns, centered glow, newsletter pill card, giant cropped wordmark, dark glowing call to action, and a floating pill.
- MenubarHorizontal bar of menus like a desktop app, built on the Popover API, with keyboard support following the WAI-ARIA Menubar pattern.
- NavbarSite header with a brand, links, dropdown menus, a sliding hover pill, an actions area, and a mobile menu with collapsible groups.
- Navigation MenuDesktop site navigation with mega menu panels on the Popover API, a sliding active indicator, hover intent, and WAI-ARIA disclosure keyboard support.