BaseDisclosure

One section that opens and closes.

Import it from rei-kit/web: import { BaseDisclosure } from 'rei-kit/web'

Open BaseDisclosure in the live documentation, where every prop below is a control you can change, in four materials and ten palettes.

Usage

<script setup lang="ts">
import { ref } from 'vue'
import { BaseDisclosure } from 'rei-kit/web'

const open = ref(false)
</script>

<template>
  <BaseDisclosure v-model="open" title="Show details">
    Everything that did not fit in the summary.
  </BaseDisclosure>
</template>

Props

Props
PropTypeRequired or defaultWhat it is for
titlestring''The question. Already translated. Optional only because the `title` slot is the other way to give one — pass exactly one of them. A disclosure with neither has a control nobody can read, which is why this is documented rather than defaulted to something.
headingLevel2 | 3 | 43Which heading the control sits inside. A heading, always — it is how a screen reader user moves between sections without opening any of them. The level depends on what is above it on the page, and getting it wrong breaks the outline.

About rei-kit

rei-kit is an accessible Vue 3 and Tailwind CSS 4 component library: 106 components, themed by role rather than by colour on three independent axes — ten WCAG-checked palettes, four materials and light or dark, each switched with one attribute. Typed, tested, SSR-safe, no runtime dependencies, MIT.

pnpm add rei-kit · npm · GitHub