Skip to main content

Accordion

Shared, editable XML components from the accordion family.

Usage​

Declare the catalog namespace in your screen and run relo-components build to bundle its dependencies before delivery. Install Components host support before session creation. Use ui:Theme or your compatible theme.

<ui:Theme xmlns:ui="urn:relo:registry:relo">
<ui:Accordion />
</ui:Theme>

Dependencies: collapsible, theme.

Exports​

ui:Accordion · ui:AccordionContent · ui:AccordionItem · ui:AccordionTrigger

ui:Accordion​

PropDefaultRequired
valuenullNo
mode'single'No
requiredfalseNo
items[]No

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

  • on-change — explicitly emitted output; inspect the definition for payload shape.

Slots​

  • default — caller children.
Definition and forwarded payloads
<Component name="Accordion" props="value=null, mode='single', required=false, items=[]" xmlns:ui="urn:relo:registry:relo">
<Column class="gap-0">
<Slot>
<For each="item" in="props.items" key="item.id">
<ui:AccordionItem bind-value="item.id" bind-expanded="(props.mode == 'single' and props.value == item.id) or (props.mode == 'multiple' and item.id in props.value)" bind-label="item.label" bind-enabled="item.enabled ?? true" on-change="call uiSelection.change with {value:props.value,item:item.id,mode:props.mode,required:props.required} into next; emit change with {value:next}">
<Text bind-text="item.content" class="font-rc-small" />
</ui:AccordionItem>
</For>
</Slot>
</Column>
</Component>

Read Accordion source.

ui:AccordionContent​

PropDefaultRequired
expandedfalseNo

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

No directly emitted output events.

Slots​

  • default — caller children.
Definition and forwarded payloads
<Component name="AccordionContent" props="expanded=false">
<Column show="props.expanded" class="gap-2 pb-2.5 transition-size spring-fast overflow-hidden">
<Slot />
</Column>
</Component>

Read AccordionContent source.

ui:AccordionItem​

PropDefaultRequired
valuenullNo
expandedfalseNo
label''No
enabledtrueNo

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

  • on-change — explicitly emitted output; inspect the definition for payload shape.

Slots​

  • default — caller children.
  • trigger — use Fill slot="trigger".
Definition and forwarded payloads
<Component name="AccordionItem" props="value=null, expanded=false, label='', enabled=true" xmlns:ui="urn:relo:registry:relo">
<Column class="border border-rc-border gap-0">
<Pressable bind-label="props.label" bind-expanded="props.expanded" bind-enabled="props.enabled" class="transition spring-fast rc-item py-2.5" on-press="emit change with {value:props.value,expanded:not props.expanded}">
<Row class="h-full flex-1 items-center justify-between gap-2">
<Slot name="trigger">
<Text bind-text="props.label" class="font-rc-small font-medium" />
</Slot>
<ui:IconChevronDown bind-class="'w-4 h-4 transition-transform spring-fast ' + (props.expanded ? 'rotate-180' : 'rotate-0')" />
</Row>
</Pressable>
<Column show="props.expanded" class="gap-2 pb-2.5 transition-size spring-fast overflow-hidden">
<Slot />
</Column>
</Column>
</Component>

Read AccordionItem source.

ui:AccordionTrigger​

PropDefaultRequired
valuefalseNo
label''No
enabledtrueNo

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

  • on-change — explicitly emitted output; inspect the definition for payload shape.

Slots​

  • default — caller children.
Definition and forwarded payloads
<Component name="AccordionTrigger" props="value=false, label='', enabled=true" xmlns:ui="urn:relo:registry:relo">
<ui:CollapsibleTrigger bind-value="props.value" bind-label="props.label" bind-enabled="props.enabled" on-change="emit change with event">
<Slot />
</ui:CollapsibleTrigger>
</Component>

Read AccordionTrigger source.

Composition and accessibility​

Use explicit value/change ownership; events do not bubble automatically. A component forwards only outputs declared by its own emits. Slots retain caller scope. Supply meaningful labels for interactive controls, preserve focus and touch targets, and test reduced motion on each platform.

Component customization · Definitions and slots · Components index