Skip to content

Add dropdown/collapsible components for page content #15

@bveeramani

Description

@bveeramani

We need dropdown/collapsible components that can be used within documentation pages to hide and show content.

What to build:
A collapsible section component that users can add to their markdown documentation. Think of it like an accordion or details/summary element - you see a title, click it, and more content expands below.

Where to work:

  • Create a new component in src/luma/app/components/ (e.g., Dropdown.tsx or Collapsible.tsx)
  • Add Markdoc configuration in src/luma/app/markdoc/ so it can be used in markdown

What it should do:

  • Show a title/heading that's always visible
  • Click the title to expand/collapse the content
  • Show a visual indicator (chevron/arrow icon) that rotates when open/closed
  • Smooth animation when opening/closing
  • Support any markdown content inside (text, code blocks, lists, etc.)

Example usage in markdown:
Users should be able to write something like:

{% dropdown title="Advanced Configuration" %}
Here's some advanced content that's hidden by default...
{% /dropdown %}

Technical approach:

  1. Create the React component with open/closed state
  2. Register it as a custom Markdoc tag (check src/luma/app/markdoc/ for examples)
  3. Style it with Tailwind CSS

Reference:
Look at how CodeBlock.tsx is implemented and registered in the Markdoc config - you'll follow a similar pattern!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions