UI / Components / doc / Toggle

Toggle

Native <details> collapse. SEO-crawled.

Wraps native `<details><summary>` with theme-aware styling. SEO-friendly: Google indexes the inner content even when collapsed. Use for FAQs, expandable sections in docs.

$npx dock-ui add toggle

Usage

import { Toggle } from "@/components/ui/toggle";

<Toggle summary="Show advanced options">
  <AdvancedOptions />
</Toggle>

Install

via CLI
$ npx dock-ui add toggle
Writes the file(s) directly to your components/ui/ folder. You own the code.
For agents
curl -L https://ui.trydock.ai/r/toggle.json
Returns a JSON manifest with file paths + contents. Agent-readable, LLM-fetchable.
← All components
Themes·Component kit · glossary
View on GitHub →