Edit in JSFiddle

can.Component.extend({
    tag: 'collapsible',
    template: '<header can-click="toggle"><h1>{{item.title}}</h1></header>' +
    '<article>{{item.content}}</article>',
    scope: {
        item: new can.Map({}),
        toggle: function(){
            this.attr('item.open', !this.attr('item.open'));
        }
    },
    events: {
        '{item} open': function(context, ev, newVal){
            this.element[newVal ? 'addClass' : 'removeClass']('open');
        }
    }
});

can.Component.extend({
    tag: 'accordion',
    template: '{{#each items}}<collapsible item="items.{{@index}}">' +
    '</collapsible>{{/each}}',
    scope: {
        items: new can.List([]),
        selected: '@',
        select: function(index){
            var items = this.attr('items');
            for(var i = 0; i < items.attr('length'); i++) {
                var isOpen = i === index;
                items[i].attr('open', isOpen);
            }
        }
    },
    events: {
        'inserted': function(){
            var selected = +(this.scope.attr('selected') || 0);
            this.scope.select(selected);
        },
        '{items} change': function(list, ev, what, how, newVal){
            if(~what.indexOf('open') && newVal) {
                var which = +what.substr(0, what.indexOf('.'));
                this.scope.select(which);
            }
        }
    }
});

var lorem = $('#lorem').text().trim();
$('#app').html(can.view('item', { items: [{
    title: 'Some title',
    content: lorem
}, {
    title: 'Title #2',
    content: lorem
}, {
    title: 'Another title',
    content: lorem
}]}));
<div id="app"></div>
<script id="lorem" type=text/text">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
 </script>
 <script id="item" type="text/mustache">
  <accordion items="items" selected="1"></accordion>
 </script>
collapsible {

	header {
		border: 1px solid black;

		h1 {
			margin: 10px;
		}
	}

	article {
		overflow: hidden;
		height: 0px;
	}

}

collapsible.open {
	
	article {
		height: auto;
	}

}

External resources loaded into this fiddle: