Accordion

Sections that open in place: one at a time, or several.

Example

One runtime, the same for every app. Pages arrive as data.

tsx
<Accordion type="single" defaultValue="what">
  <AccordionItem value="what">
    <AccordionTrigger>What does the browser download?</AccordionTrigger>
    <AccordionContent>
      <Text>One runtime, the same for every app. Pages arrive as data.</Text>
    </AccordionContent>
  </AccordionItem>
  <AccordionItem value="where">
    <AccordionTrigger>Where does it run?</AccordionTrigger>
    <AccordionContent>
      <Text>On Bun, Deno, or Cloudflare Workers with D1.</Text>
    </AccordionContent>
  </AccordionItem>
</Accordion>

Usage

Pages are built on the server: import the tags from @dash/server and return the tree. The browser runtime draws it.
tsx
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent, Text } from "@dash/server";

Props

AccordionProps

Prop
Type
Description
type"single" | "multiple"
defaultValuestring | string[]
valuestring | string[]
onValueChange(value: string | string[]) => void

AccordionItemProps

Prop
Type
Description
value (required)string
On this page