Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new accordion props #2053

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions packages/blade/src/components/Accordion/_decisions/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ import { Accordion, AccordionItem } from '@razorpay/blade';
</Accordion>;
```

### WIP Custom Accordion Header

```jsx
import { Accordion, AccordionItem } from '@razorpay/blade';

<Accordion showNumberPrefix defaultExpandedIndex={0}>
<AccordionItem header={<div>header slot</div>}>
<div>Slot</div>
</AccordionItem>
<AccordionItem title="How can I transfer money to customers?" description="Just use Razorpay" />
</Accordion>;
```

### Accordion

| Prop | Type | Default | Description | Required |
Expand All @@ -63,12 +76,15 @@ import { Accordion, AccordionItem } from '@razorpay/blade';

### AccordionItem

| Key | Type | Default | Description | Required |
| ----------- | --------------- | ----------- | -------------------------------------------------------------------------- | -------- |
| title | `string` | `undefined` | Title text content | ✅ |
| description | `string` | `undefined` | Body text content | |
| icon | `IconComponent` | `undefined` | Renders a Blade icon as title prefix (requires `showNumberPrefix={false}`) | |
| children | `JSX` | `undefined` | Slot, renders any custom content | |
| Key | Type | Default | Description | Required |
| -------------- | ------------------------------- | ----------- | -------------------------------------------------------------------------- | -------- |
| title | `string` | `undefined` | Title text content | ✅ |
| description | `string` | `undefined` | Body text content | |
| header | `JSX` | `undefined` | Header JSX content | |
| icon | `IconComponent` | `undefined` | Renders a Blade icon as title prefix (requires `showNumberPrefix={false}`) | |
| children | `JSX` | `undefined` | Slot, renders any custom content | |
| isExpanded | `boolean` | `undefined` | Expanded state control when individual item is used | |
| onExpandChange | (isExpanded: `boolean`) => void | `undefined` | Callback for handling change in expand state when individual item is used | |

## a11y

Expand Down
Loading