Overview
TheDropDown component is a reusable accordion UI element that displays a question/heading with two collapsible answer sections. It’s used by the Ethos component to create an interactive philosophy section.
Props Interface
src/components/DropDown.tsx
The main heading text that’s always visible (e.g., an investment principle)
First supporting detail revealed when expanded
Second supporting detail revealed when expanded
Controls the expanded/collapsed state. When
true, shows the answer sections with a scale-in animation.Visual States
The component has two distinct visual states:- Collapsed
- Expanded
- Background opacity: 10%
- Plus icon (
+) displayed - Answer sections scaled to 0 height
- Only question text visible
Animation Behavior
The component uses a vertical scale transform with
origin-top for a smooth accordion effect. The 500ms ease-in-out transition creates a professional reveal animation.Usage Example
FromEthos.tsx:
The parent component manages which accordion is open via the
active state. Only one can be expanded at a time - clicking the active item collapses it, clicking an inactive item opens it.Styling
Background & Layout
The component uses:- Dark green background with opacity-based states
- Full width container with rounded corners (
rounded-lg) - Responsive padding:
px-6 py-3 xl:py-4 2xl:py-8 - Minimum height scales with breakpoint:
lg:min-h-16 xl:min-h-24 2xl:min-h-28
Typography
Question (heading):font-semibold- Responsive sizes:
lg:text-b3xs xl:text-bxs 2xl:text-bsm
- Left-aligned text
- Responsive sizes:
lg:text-b4xs xl:text-b2xs 2xl:text-bxs - Scrollable when content exceeds max height
Icon Toggle
Responsive Design
The component adapts across three main breakpoints:| Breakpoint | Text Size | Padding Y | Min Height | Icon Size |
|---|---|---|---|---|
lg (1024px) | b3xs / b4xs | 3 (0.75rem) | 16 (4rem) | 4 (1rem) |
xl (1440px) | bxs / b2xs | 4 (1rem) | 24 (6rem) | 8 (2rem) |
2xl (1920px) | bsm / bxs | 8 (2rem) | 28 (7rem) | 10 (2.5rem) |
Accessibility Considerations
Integration Points
This component is used exclusively by theEthos component to display Sunflower Capital’s four investment principles. Each principle gets its own DropDown instance with unique question and answer content.
Ethos Component
See how DropDown is integrated into the philosophy section
Custom Animations
Learn about the scale-y animation pattern