elastic / elastic/eui

[EuiAccordion] Migrate from class to function component

Open
#9,465 2 comments 0 reactions 0 assignees View on GitHub
help wanted low hanging fruit
Dominant language
TypeScript
Stars
6.4k
Forks
911
Avg merge
2d 11h
Merged PRs (30d)
65

Description

`EuiAccordion` is a collapsible content container with open/close toggle. Commonly used for progressive disclosure UI patterns.

- **File:** `components/accordion/accordion.tsx`
- **Class size:** 123 lines
- **State:** `isOpen`
- **Lifecycle:** None

**Migration notes:**

Simple — single boolean state, no lifecycle methods. The component is wrapped with `withEuiTheme` HOC which may also be replaceable with `useEuiTheme` hook.

**Acceptance criteria:**

- [ ] Convert to function component with `useState`
- [ ] Replace `withEuiTheme` HOC with `useEuiTheme` hook if applicable
- [ ] Maintain controlled/uncontrolled open state behavior
- [ ] All existing tests pass

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.