I have tried the following but it doesn’t seem to work, there’s no accordion UI in the editor:
$output = array (
'key' => $field_prefix . "accordion",
'label' => 'Accordion',
'prefix' => '',
'type' => 'accordion',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'open' => 0,
'multi_expand' => 0,
);
Which is then added to the layouts field of a flexible layout.
Accordion fields are like tab fields. It will not work unless there are additional fields in the group after the field.
Accordion fields are only for the admin and will not help you format content on the front of your site.