Skip to content

Collapsible Panels

---
import {CollapsiblePanel} from 'astro-nebula-ui'
---
<CollapsiblePanel title="Panel Title">
Your content goes here
</CollapsiblePanel>

Your content goes here

---
import {CollapsiblePanel} from 'astro-nebula-ui'
---
<CollapsiblePanel title="Already Expanded" expanded={true}>
This starts open
</CollapsiblePanel>

This starts open

---
import {CollapsiblePanel} from 'astro-nebula-ui'
---
<CollapsiblePanel title="Outline Style" variant="outline">
Different visual style
</CollapsiblePanel>

Different visual style

---
import {CollapsiblePanel} from 'astro-nebula-ui'
---
<CollapsiblePanel title="Ghost Style" variant="ghost">
Minimal styling
</CollapsiblePanel>

Minimal styling

The CollapsiblePanel component accepts the following properties:

PropertyTypeDefaultDescriptionExample
titlestringRequiredThe title text displayed in the panel header"Getting Started"
expandedbooleanfalseWhether the panel starts in an expanded statetrue
variant"default" | "outline" | "ghost""default"Visual style variant of the panel"outline"
theme"auto" | "light" | "dark""auto"Force a specific theme (overrides auto-detection)"dark"

Here are examples showing each property in use:

<CollapsiblePanel title="Basic Panel">
Content goes here
</CollapsiblePanel>
<CollapsiblePanel
title="Advanced Configuration"
expanded={true}
variant="outline"
theme="dark"
>
This panel starts expanded, uses outline styling, and forces dark theme
</CollapsiblePanel>

This panel starts expanded, uses outline styling, and forces dark theme

VariantDescriptionBest Used For
defaultFull styling with background and shadowPrimary content, main sections
outlineTransparent background with accent borderSecondary content, nested sections
ghostMinimal styling, clean appearanceSubtle organization, FAQ sections
ThemeBehavior
autoAutomatically adapts to user’s system preference or Starlight theme
lightForces light theme colors regardless of system preference
darkForces dark theme colors regardless of system preference

The component supports rich Markdown content, including lists, formatting, and code blocks:

---
import {CollapsiblePanel} from 'astro-nebula-ui'
---
<CollapsiblePanel title="Getting Started">
- Install the package
- Import the component
- Add to your Astro file
- Customize as needed
</CollapsiblePanel>
  • Install the package
  • Import the component
  • Add to your Astro file
  • Customize as needed
---
import {CollapsiblePanel} from 'astro-nebula-ui'
---
<CollapsiblePanel title="Advanced Features" variant="outline">
- **Bold text** for emphasis
- *Italic text* for subtlety
- `Code snippets` for technical terms
- [Links](https://example.com) to external resources
- Multiple paragraphs with detailed explanations
You can also include regular paragraphs alongside lists for more comprehensive content.
</CollapsiblePanel>
  • Bold text for emphasis
  • Italic text for subtlety
  • Code snippets for technical terms
  • Links to external resources
  • Multiple paragraphs with detailed explanations

You can also include regular paragraphs alongside lists for more comprehensive content.

---
import {CollapsiblePanel} from 'astro-nebula-ui'
---
<CollapsiblePanel title="Project Structure" variant="ghost">
## Frontend Development
- **React Components**
- Functional components
- Class components
- Custom hooks
- **Styling Options**
- CSS Modules
- Styled Components
- Tailwind CSS
## Backend Development
- **API Design**
- RESTful endpoints
- GraphQL schemas
- Authentication
- **Database**
- Schema design
- Query optimization
- Data migrations
### Code Example
\`\`\`js
const component = () => {
return <div>Hello World</div>;
}
\`\`\`
</CollapsiblePanel>
  • React Components
    • Functional components
    • Class components
    • Custom hooks
  • Styling Options
    • CSS Modules
    • Styled Components
    • Tailwind CSS
  • API Design
    • RESTful endpoints
    • GraphQL schemas
    • Authentication
  • Database
    • Schema design
    • Query optimization
    • Data migrations
const component = () => {
return <div>Hello World</div>;
}