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-collapsible

v0.153.1

Published

A single expandable section with animated open/close. Use for "Show more" patterns, technical details, or any card-level secondary content; for stacked lists, use `@xsolla/xui-b2b-accordion`.

Readme

Collapsible

A single expandable section with animated open/close. Use for "Show more" patterns, technical details, or any card-level secondary content; for stacked lists, use @xsolla/xui-b2b-accordion.

Installation

npm install @xsolla/xui-b2b-collapsible

Imports

import {
  Collapsible,
  type CollapsibleProps,
  type CollapsibleView,
} from '@xsolla/xui-b2b-collapsible';

Quick start

import { Collapsible } from '@xsolla/xui-b2b-collapsible';

<Collapsible title="Setup" caption="Step 1 of 3" view="white-surface">
  <p>Body content goes here.</p>
</Collapsible>;

API Reference

<Collapsible>

| Prop | Type | Default | Description | | --- | --- | --- | --- | | title | ReactNode | — | Required. Title text or node in the trigger row. | | children | ReactNode | — | Required. Body content shown when expanded. | | view | CollapsibleView | "without-surface" | Visual surface style. | | caption | ReactNode | — | Secondary text rendered below the title. | | icon | ReactNode | — | Optional 32×32 left slot. Consumer controls styling — wrap with IconWrapper or pass a Checkbox. 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). | | defaultOpen | boolean | false | Initial open state for uncontrolled usage. | | open | boolean | — | Controlled open state. | | onOpenChange | (open: boolean) => void | — | Called when open state changes. | | className | string | — | CSS class applied to the root element. | | aria-label | string | auto | Accessible label for the trigger. Defaults to title when it is a string. |

Inherits ThemeOverrideProps (themeMode, themeProductContext).

CollapsibleView

type CollapsibleView = 'without-surface' | 'white-surface' | 'grey-surface';

| Value | Appearance | | --- | --- | | without-surface | No background; bottom border divider. | | white-surface | White card with rounded corners. | | grey-surface | Tinted overlay-mono card with rounded corners. |

Deprecated props

The following are still accepted for migration from @xsolla/publisher-account-core and trigger an IDE @deprecated warning:

| Deprecated | Replacement | Notes | | --- | --- | --- | | onChange | onOpenChange | Same (isOpen: boolean) => void signature. | | statusIcon | trailing | Same shape. | | description | caption | Covers the legacy lg-size description. |

Props with no equivalent (intentional redesign): backgroundColor, size, childContentPadding, label (sm size), openingState (use open / defaultOpen).

Examples

Three view variants

import { Collapsible } from '@xsolla/xui-b2b-collapsible';

<>
  <Collapsible title="Without surface" view="without-surface">
    <p>Content</p>
  </Collapsible>
  <Collapsible title="White surface" view="white-surface">
    <p>Content</p>
  </Collapsible>
  <Collapsible title="Grey surface" view="grey-surface">
    <p>Content</p>
  </Collapsible>
</>;

Open by default

import { Collapsible } from '@xsolla/xui-b2b-collapsible';

<Collapsible title="Pre-expanded" view="white-surface" defaultOpen>
  <p>Visible on first render.</p>
</Collapsible>;

With icon slot

import { Collapsible } from '@xsolla/xui-b2b-collapsible';
import { IconWrapper } from '@xsolla/xui-icon-wrapper';
import { ReverseLeft } from '@xsolla/xui-icons-base';

<Collapsible
  title="Setup"
  view="white-surface"
  icon={
    <IconWrapper size="md" shape="smooth">
      <ReverseLeft aria-hidden />
    </IconWrapper>
  }
>
  <p>Content</p>
</Collapsible>;

With trailing slot

import { Collapsible } from '@xsolla/xui-b2b-collapsible';
import { Status } from '@xsolla/xui-status';

<Collapsible
  title="Publish your game store page"
  caption="Publishing"
  view="white-surface"
  trailing={
    <Status palette="warning" size="md" labelType="dot-color">In progress</Status>
  }
>
  <p>Content</p>
</Collapsible>;

Controlled

import { useState } from 'react';
import { Collapsible } from '@xsolla/xui-b2b-collapsible';

function ControlledCollapsible() {
  const [open, setOpen] = useState(false);
  return (
    <Collapsible
      title="Controlled"
      view="white-surface"
      open={open}
      onOpenChange={setOpen}
    >
      <p>Content</p>
    </Collapsible>
  );
}

Accessibility

  • Trigger has role="button", tabIndex={0}, aria-expanded, and aria-controls linking to the panel.
  • Responds to Enter and Space; the icon and trailing slots stop click/keyboard events so embedded controls do not toggle the trigger.
  • Panel content is always in the DOM (hidden via grid-template-rows: 0fr) for screen-reader access.

Migration

Migrating from @xsolla/publisher-account-core:

// Before
import { Collapsible } from '@xsolla/publisher-account-core';

<Collapsible
  title="Setup"
  description="Step 1 of 3"
  backgroundColor="primary"
  size="lg"
  statusIcon={<CheckIcon />}
  openingState={false}
  onChange={(isOpen) => console.log(isOpen)}
>
  content
</Collapsible>;

// After
import { Collapsible } from '@xsolla/xui-b2b-collapsible';

<Collapsible
  title="Setup"
  caption="Step 1 of 3"
  view="white-surface"
  trailing={<CheckIcon aria-hidden />}
  defaultOpen={false}
  onOpenChange={(isOpen) => console.log(isOpen)}
>
  content
</Collapsible>;