public function create($title = null, $options = []) {

        if (is_array($title)) {
            $options = $title;
            $title   = null;
        }

        $out = '';

        // close previous panel if in group
        if ($this->_states->is('panel') && $this->_states->getValue('inGroup')) {
            $out .= $this->end();
        }

        $options += [
            'body'     => true,
            'type'        => 'default',
            'collapsible' => $this->_states->is('group') ?
                $this->_states->getValue('groupCollapsible') : $this->getConfig('collapsible'),
            'open'        => !$this->_states->is('group'),
            'panel-count' => $this->_panelCount,
            'title' => [],
            'templateVars' => []
        ];

        $this->_panelCount = intval($options['panel-count']) + 1;

        // check open
        $open = $options['open'];
        if ($this->_states->is('group')) {
            // increment count inside
            $this->_states->setValue('groupPanelCount',
                $this->_states->getValue('groupPanelCount') + 1);
            $open = $open
                || $this->_states->getValue('groupPanelOpen')
                    == $this->_states->getValue('groupPanelCount');
        }

        $out .= $this->formatTemplate('panelStart', [
            'type' => $options['type'],
            'attrs' => $this->templater()->formatAttributes(
                $options, ['body', 'type', 'collapsible', 'open', 'panel-count', 'title']),
            'templateVars' => $options['templateVars']
        ]);

        $this->_states->push('panel', [
            'part' => null,
            'bodyId' => 'collapse-'.$options['panel-count'],
            'headId' => 'heading-'.$options['panel-count'],
            'collapsible' => $options['collapsible'],
            'open' => $open,
            'inGroup' => $this->_states->is('group'),
            'groupId' => $this->_states->is('group') ?
                $this->_states->getValue('groupId') : 0
        ]);

        if (is_string($title) && $title) {
            $out .= $this->_createHeader($title, [
                'title' => $options['title']
            ]);
            if ($options['body']) {
                $out .= $this->_createBody();
            }
        }

        return $out;
    }