Skip to Content

AmenityListSection

Organize accommodation facilities into accessible, responsive categories and layouts.

AmenityListSection presents facilities grouped by category. It supports compact or expanded content, grid or list layout, optional native collapsible groups, icons, and custom React content.

Beta API maturity: Beta.

Installation

import { AmenityListSection, type AmenityCategory } from "@puzzle-ui/pieces";

Variant previews

The preview covers compact and expanded content in both layouts, plus native collapsible categories.

compact-grid - Compact labels in a fluid grid.

390 × 844

compact-list - Compact rows in a single column.

390 × 844

expanded-grid - Descriptions and icons in a responsive grid.

390 × 844

expanded-list - Descriptions and icons in a single column.

390 × 844

collapsible - Let guests expand only the categories they need.

390 × 844

API

Prop or typeTypeDescription
categoriesreadonly AmenityCategory[]Required categories with stable IDs, names, and amenity lists.
variantAmenityListVariantexpanded (default) shows descriptions; compact omits descriptions.
layoutAmenityListLayoutgrid (default) or list.
collapsiblebooleanUses native <details> groups when true; defaults to false.
defaultExpandedbooleanInitial open state for collapsible categories; defaults to false.
AmenityCategory.itemsreadonly Amenity[]Facilities within the category. Empty categories are omitted.
Amenity.labelReactNodeRequired visible name.
Amenity.iconReactNodeOptional decorative icon; the visible label remains the accessible name.
Amenity.descriptionReactNodeOptional supporting description, shown by the expanded variant.
Amenity.contentReactNodeOptional custom content shown in either variant.
Shared section propsMarketingSectionBasePropsSemantic section, heading, actions, children, theme, and native attributes.

Required and default values

PropRequiredDefault
categoriesYes—
variantNo"expanded"
layoutNo"grid"
collapsibleNofalse
defaultExpandedNofalse

TypeScript example

const facilities: AmenityCategory[] = [
  {
    id: "comfort",
    name: "Comfort",
    items: [
      {
        id: "wifi",
        label: "High-speed Wi-Fi",
        description: "Available throughout the accommodation.",
      },
      {
        id: "linen",
        label: "Fresh linen",
        content: <a href="/guest-guide#linen">Read the linen policy</a>,
      },
    ],
  },
];

<AmenityListSection
  title="Facilities"
  categories={facilities}
  variant="expanded"
  layout="grid"
  collapsible
/>;

Category IDs must be unique; amenity IDs must be unique within each category. The component does not infer a standard amenity taxonomy or generate icons.

Accessibility

Collapsible groups use native <details> and <summary>, preserving browser keyboard interaction and expanded state. Category names are the summary labels; every icon is decorative because each amenity retains its visible text label. Provide accessible names inside custom content for interactive elements.

Responsive behavior

The grid uses fluid auto-fitting columns and collapses to one column when space is limited. The list always uses one column. Long names and descriptions wrap naturally; no fixed heights or clipping are applied.

Theme support

Borders, surfaces, muted text, and icon emphasis use Puzzle semantic tokens. The section inherits light, dark, and scoped themes without requiring a provider beyond the application's existing Theme setup.

Customization

Provide any React node as an amenity icon or custom content. children can add section-level content without replacing the typed category data.

<AmenityListSection
  categories={facilities}
  collapsible
  defaultExpanded
  className="brand-facilities"
>
  <p>Ask us if you need anything not listed.</p>
</AmenityListSection>

Composition

Use this component in AccommodationDetailsSection's facilities slot, or alongside the AccommodationOverviewSection. See the complete accommodation discovery example.

Framework compatibility

The component is server-renderable and does not use React state or browser globals. Native disclosure interaction works in Next.js and TanStack Start. See the Pieces framework integration guide for setup guidance.