npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xsolla/xui-b2b-accordion

v0.173.2

Published

A stacked list of `Collapsible` items with coordinated open/close behaviour. By default only one item can be open at a time; pass `multiple` to allow several open simultaneously.

Readme

Accordion

A stacked list of Collapsible items with coordinated open/close behaviour. By default only one item can be open at a time; pass multiple to allow several open simultaneously.

For a single standalone expandable section, use @xsolla/xui-b2b-collapsible.

Installation

npm install @xsolla/xui-b2b-accordion

@xsolla/xui-b2b-collapsible is a peer dependency and is installed automatically.

Imports

import {
  Accordion,
  type AccordionItem,
  type AccordionProps,
} from "@xsolla/xui-b2b-accordion";

Quick start

import { Accordion, type AccordionItem } from "@xsolla/xui-b2b-accordion";

const items: AccordionItem[] = [
  {
    key: "what",
    title: "What is Xsolla?",
    content: <p>Global video game commerce.</p>,
  },
  {
    key: "sdk",
    title: "How do I integrate the SDK?",
    content: <p>Follow the integration guide.</p>,
  },
];

<Accordion items={items} defaultOpenKeys={["what"]} />;

API Reference

<Accordion>

| Prop | Type | Default | Description | | ----------------- | -------------------------- | ------- | ------------------------------------------------------------------------------------------------------------- | | testID | string | — | Test ID for testing frameworks. On web this renders as data-testid; on React Native it renders as testID. | | items | AccordionItem[] | — | Required. Array of item definitions. | | multiple | boolean | false | Allow more than one item open simultaneously. | | defaultOpenKeys | string[] | [] | Keys open on first render (uncontrolled). | | openKeys | string[] | — | Controlled open keys. | | onOpenChange | (keys: string[]) => void | — | Called when open keys change. | | className | string | — | CSS class applied to the root wrapper. |

Inherits ThemeOverrideProps (themeMode, themeProductContext).

AccordionItem

| Field | Type | Description | | ---------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | key | string | Required. Unique identifier used for open/close tracking. | | title | ReactNode | Required. Title text or node in the trigger row. | | content | ReactNode | Required. Body content shown when expanded. | | caption | ReactNode | Secondary text below the title. | | icon | ReactNode | Optional 32×32 left slot. Wrap with IconWrapper, or pass a Checkbox for selection-style accordions. Click events on this slot are stopped before they reach the trigger. | | trailing | ReactNode | Content to the right of the text, before the chevron (e.g. Status). |

Examples

Setup guide pattern

import { Accordion, type AccordionItem } from "@xsolla/xui-b2b-accordion";
import { Status } from "@xsolla/xui-status";

const items: AccordionItem[] = [
  {
    key: "template",
    title: "Create and review the template of your game store page",
    trailing: (
      <Status palette="success" size="md" labelType="dot-color">
        Done
      </Status>
    ),
    content: <p>Content here.</p>,
  },
  {
    key: "tips",
    title: "See tips and tricks for your game store",
    trailing: (
      <Status palette="warning" size="md" labelType="dot-color">
        In progress
      </Status>
    ),
    content: <p>Content here.</p>,
  },
  {
    key: "keys",
    title: "Set up game keys to sell on your game store page",
    trailing: (
      <Status palette="default" size="md" labelType="dot-color">
        Pending
      </Status>
    ),
    content: <p>Content here.</p>,
  },
];

<Accordion items={items} defaultOpenKeys={["template"]} />;

With checkbox left slot

import { useState } from "react";
import { Accordion, type AccordionItem } from "@xsolla/xui-b2b-accordion";
import { Checkbox } from "@xsolla/xui-checkbox";

function Selectable() {
  const [done, setDone] = useState<Record<string, boolean>>({});
  const make = (key: string, title: string): AccordionItem => ({
    key,
    title,
    icon: (
      <Checkbox
        size="md"
        checked={!!done[key]}
        onChange={(e) => setDone((d) => ({ ...d, [key]: e.target.checked }))}
      />
    ),
    content: <p>Step body.</p>,
  });

  return (
    <Accordion
      items={[
        make("one", "Connect your store"),
        make("two", "Add at least one product"),
        make("three", "Publish"),
      ]}
    />
  );
}

Multiple open

<Accordion items={items} multiple defaultOpenKeys={["what", "sdk"]} />

Controlled

import { useState } from "react";

function ControlledAccordion({ items }) {
  const [openKeys, setOpenKeys] = useState<string[]>(["what"]);
  return (
    <Accordion
      items={items}
      multiple
      openKeys={openKeys}
      onOpenChange={setOpenKeys}
    />
  );
}

Accessibility

  • Each item's trigger inherits Collapsible's role="button", tabIndex={0}, and aria-expanded semantics.
  • Triggers respond to Enter and Space; the icon and trailing slots stop click propagation so interactive elements inside them (checkboxes, buttons) do not toggle the panel.
  • Panel content is always in the DOM (hidden via grid-template-rows: 0fr) so screen readers can reach it.

Behaviour

  • All items render as Collapsible with view="white-surface".
  • In single mode (default), opening an item closes the others; in multiple mode, items toggle independently.
  • Controlled mode (openKeys + onOpenChange) overrides internal state.