Pivot Docs

    Accordion Stand Alone

    pivot-accordion-stand-alone is a single, isolated disclosure web component that shows or hides a section of content. Unlike pivot-accordion-item, it is used on its own and is not wrapped in a pivot-accordion-default or pivot-accordion-elevated. It uses a lighter header style than the list accordion: a top border on the header, a bottom border on the panel, and smaller label typography.


    Quick Start

    <pivot-accordion-stand-alone pivot-label="Show details">
    <p>Place any content here — text, lists, forms, or other components.</p>
    </pivot-accordion-stand-alone>

    To start in the expanded state, include the pivot-open attribute:

    <pivot-accordion-stand-alone pivot-label="Show details" pivot-open>
    <p>This panel is already expanded on page load.</p>
    </pivot-accordion-stand-alone>

    Using the pivot-accordion-stand-alone-toggle event

    Fired on every toggle, whether opening or closing. The event bubbles and is composed, so it crosses shadow DOM boundaries.

    document
    .querySelector("pivot-accordion-stand-alone")
    .addEventListener("pivot-accordion-stand-alone-toggle", (e) => {
    console.log("Label:", e.detail.label);
    console.log("Now open:", e.detail.pivotOpen);
    });

    Detail shape:

    {
    pivotOpen: boolean; // true when the panel was just opened, false when closed
    label: string; // the pivot-label value
    }

    This event fires from user interaction with the header button only (click, Enter, or Space) — setting the pivot-open attribute or pivotOpen property programmatically does not dispatch it.


    Behavior

    Expand and Collapse

    Clicking anywhere in the header button toggles the panel open or closed. Content expands and collapses using a CSS grid row animation (grid-template-rows: 0fr → 1fr), which avoids JavaScript-driven height measurement.

    While collapsed, the panel is also set to visibility: hidden, which removes its content from the accessibility tree and the Tab order. Visibility transitions with the height animation, so content stays visible until the panel finishes closing and appears as soon as it starts opening.

    The pivot-open attribute reflects the current state and is used as a CSS selector hook:

    • pivot-open present → panel is expanded
    • pivot-open absent → panel is collapsed

    Motion and Reduced Motion

    The expand/collapse animation and chevron rotation both use CSS transitions. Under prefers-reduced-motion: reduce, all transitions are disabled and states change instantly.


    Accessibility

    pivot-accordion-stand-alone follows the ARIA Disclosure Pattern.

    ARIA Roles and Attributes

    Element Role / Attribute Value Purpose
    <button> aria-expanded "true" / "false" Communicates the expanded or collapsed state to assistive technology
    <button> aria-controls "accordion-content-{nanoid}" Associates the button with the panel it controls
    Panel <div> role="region" — Creates an accessible landmark region for the panel content
    Panel <div> aria-labelledby "accordion-label-{nanoid}" Associates the region with its header button for an accessible name
    Panel <div> hidden boolean Hides collapsed content from all users, including screen reader users

    The chevron icon is decorative SVG and carries no accessible text. The expanded/collapsed state is communicated entirely through aria-expanded on the button.

    Screen Reader Behavior

    The header is announced as a button named by pivot-label, along with its state — for example, “Show details, button, collapsed.” When expanded, the panel is exposed as a region landmark named by the same label, so its content is reachable both in reading order and through landmark navigation. While collapsed, the panel content is hidden from screen readers and skipped by Tab.

    Keyboard Navigation

    Key Action
    Tab Moves focus to the next focusable element (interactive content within an open panel, etc)
    Shift + Tab Moves focus to the previous focusable element
    Enter or Space Toggles the panel open or closed

    Focus Management

    The component inherits delegatesFocus: true from PivotBase, so calling .focus() on the host delegates to the internal header button.


    Related Components

    • Accordion Default — use when several related disclosures belong together in a list.
    • Accordion Elevated — card-styled group where only one item is open at a time.
    • Accordion Item — the grouped counterpart to this component; shares its chevron icon.

    References


    API Reference

    Props

    Name Type Default Description
    pivot-label string "" The label text displayed in the header button.
    pivot-open boolean false Controls whether the panel is expanded or collapsed.

    Slots

    Name Description
    default Content displayed inside the expanded panel

    Events

    Name Type Description
    pivot-accordion-stand-alone-toggle CustomEvent Fired when the panel is expanded or collapsed. Detail: `{ pivotOpen: boolean, label: string }`

    CSS Custom Properties

    Name Description
    --component-accordion-stand-alone-gap Gap between the label and chevron in the button.
    --component-accordion-stand-alone-inset-y Vertical padding of the header button.
    --component-accordion-stand-alone-inset-x Horizontal padding of the header button.
    --component-accordion-border Width of the header's top border and the panel's bottom border.
    --component-divider-default Color of the header's top border and the panel's bottom border.
    --typography-constants-headline-family Font family of the label.
    --typography-headline-xs-size Font size of the label.
    --typography-headline-xs-height Line height of the label.
    --component-button-secondary-default-label Text color of the label.
    --global-color-icons-font-awesome-default-color Color of the chevron icon.
    --component-accordion-list-inset-x Horizontal padding of the panel content while collapsed.
    --component-accordion-elevated-inset-y Vertical padding of the panel content while expanded.
    --component-accordion-elevated-inset-x Horizontal padding of the panel content while expanded.