Intentwise Primitives

Panels & Accordions

Expandable panels and accordions for recommendations and collapsible content. CollapsiblePanel supports controlled/uncontrolled state and optional localStorage persistence; RecommendationAccordion displays a list of recommendation items with optional delete actions.

CollapsiblePanel (default expanded)

Panel with title and body. Click the header to collapse or expand.

Filters

Place filter controls or any content here. The panel can be collapsed to save space.
Show code
<CollapsiblePanel title="Filters" defaultExpanded={true}>
  <div className="p-4">Panel content here.</div>
</CollapsiblePanel>

CollapsiblePanel with header actions

Use headerActions to add buttons or summary text to the right of the title.

Show code
<CollapsiblePanel
  title="Advanced options"
  headerActions={<span className="text-xs text-iw-text-muted">3 selected</span>}
>
  ...
</CollapsiblePanel>

RecommendationAccordion

Recommendation list

Accordion showing recommendation items with count, description (supports **bold**), and date. Optional onItemDelete callback for remove actions.

12
Sponsored Product keyword bids
07th Mar
5
Sponsored Brand campaign budgets
06th Mar
3
Sponsored Display targeting adjustments
05th Mar
Show code
<RecommendationAccordion
  title="BID OPTIMIZATION"
  items={[
    { id: '1', count: 12, description: 'Sponsored Product **keyword** bids', date: '07th Mar' },
    ...
  ]}
  onItemDelete={(id) => {}}
/>

RecommendationAccordion (collapsed by default)

Use defaultExpanded={false} to start collapsed.

12
Sponsored Product keyword bids
07th Mar
5
Sponsored Brand campaign budgets
06th Mar
Show code
<RecommendationAccordion title="..." items={items} defaultExpanded={false} />

RecommendationAccordion β€” clickable rows

Pass onItemClick to make the row body interactive (cursor + focus ring). Useful when each recommendation links to a detail page or filtered table view. The right-side action button is independent.

07th Mar
06th Mar
05th Mar
Show code
<RecommendationAccordion
  title="BID OPTIMIZATION"
  items={items}
  onItemClick={(id) => router.push('/keywords?rec=' + id)}
  onItemDelete={(id) => dismiss(id)}
/>

RecommendationAccordion β€” restore action mode

Pass actionMode="restore" to show a "Restore" pill button instead of the trash icon (e.g. for a Dismissed tab). Wire onItemAction to restore the recommendation; falls back to onItemDelete if omitted.

12
Sponsored Product keyword bids
07th Mar
5
Sponsored Brand campaign budgets
06th Mar
3
Sponsored Display targeting adjustments
05th Mar
Show code
<RecommendationAccordion
  title="BID OPTIMIZATION"
  items={dismissedItems}
  actionMode="restore"
  onItemAction={(id) => restore(id)}
/>

RecommendationAccordion β€” no action button

Pass actionMode="none" to render rows without a right-side action button. Combine with onItemClick for a pure list-of-links experience.

07th Mar
06th Mar
05th Mar
Show code
<RecommendationAccordion
  title="KEYWORD TARGETING"
  items={items}
  actionMode="none"
  onItemClick={(id) => navigate(id)}
/>

RecommendationAccordion β€” persisted expanded state

Pass storageKey to persist the expanded/collapsed state to localStorage. Survives reloads and remounts. Use a unique key per accordion instance.

12
Sponsored Product keyword bids
07th Mar
5
Sponsored Brand campaign budgets
06th Mar
Show code
<RecommendationAccordion
  title="BID OPTIMIZATION"
  items={items}
  storageKey="walmart-recommendations:active:bid"
/>

RecommendationAccordion β€” fully controlled

Pass expanded + onExpandedChange to fully own the open/close state externally. Useful when synchronizing multiple panels or driving from URL/router state.

12
Sponsored Product keyword bids
07th Mar
5
Sponsored Brand campaign budgets
06th Mar
3
Sponsored Display targeting adjustments
05th Mar
Show code
const [open, setOpen] = useState(true);

<RecommendationAccordion
  title="..."
  items={items}
  expanded={open}
  onExpandedChange={setOpen}
/>