Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sure-developer.com/llms.txt

Use this file to discover all available pages before exploring further.

Accordion

Accordion renders expandable sections from an item array.
ui.accordion({
  {
    title = 'How is this page made?',
    content = 'Use sure.getModule("lui") and build pages with Lua nodes.',
    value = 'how'
  },
  {
    title = 'Where is the HTML?',
    content = 'The renderer is bundled in sure_lib.',
    value = 'html'
  }
}, {
  closedIconComponent = 'lucide:plus',
  openIconComponent = 'lucide:minus'
})

API

ui.accordion(items, props?)

Item shape

FieldTypeDescription
value or idstringStable item id. Defaults to item-N.
title or labelstringTrigger text. Defaults to value.
content or descriptionstringExpanded body text.
disabledbooleanDisables the trigger when true.

Props

PropTypeDescription
type'single' | 'multiple'Multiple mode keeps more than one item open.
collapsiblebooleanDefaults to true. Set false to keep the active item open.
defaultValuestringInitial open item. Defaults to the first item value.
openIcon, openIconComponent, activeIcon, activeIconComponenticonOpen icon.
closedIcon, closedIconComponent, icon, iconComponenticonClosed icon.
itemClassNamestringItem wrapper class.
triggerClassName, activeTriggerClassName, openTriggerClassNamestringTrigger classes.
titleClassNamestringTitle span class.
contentClassNamestringExpanded content class.