Skip to content
On this page

Accordion

Collapsible sections that reveal or hide related content.

Accordion in FluttyUIAccordion in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

Usage

const ui.Accordion(
  items: [
    ui.AccordionItem(
      title: Text('What is FluttyUI?'),
      content: Text('A Flutter toolkit built on the widgets layer.'),
    ),
  ],
)

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

Accordion

const Accordion({
  super.key,
  required this.items,
  this.size,
  this.allowMultiple = true,
  this.headerPadding,
  this.contentPadding,
  this.divider,
  this.backgroundColor,
  this.borderColor = const Color(0xFFE9E9EC),
  this.borderRadius,
});
ParameterTypeRequiredDefault
keyKey?Nonull
itemsList<AccordionItem>Yes—
sizeComponentSize?Nonull
allowMultipleboolNotrue
headerPaddingEdgeInsetsGeometry?Nonull
contentPaddingEdgeInsetsGeometry?Nonull
dividerWidget?Nonull
backgroundColorColor?Nonull
borderColorColorNoconst Color(0xFFE9E9EC)
borderRadiusdouble?Nonull

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/navigation/accordion/accordion.dart

This reference is generated from the Accordion declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI