@lucy.wang, there are three ways that I have done this in the past.
1. Just making sure that your componentGroup is set to .hidden
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Image Carousel"
jcr:description="Image Carousel Component for Content Creation"
componentGroup=".hidden"/>
2. Just making sure your sub-components have a unique componentGroup name, and then using the "cq:EditListenersConfig" configuration, to update the components list.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
cq:actions="[edit]"
cq:dialogMode="floating"
cq:disableTargeting="{Boolean}true"
jcr:primaryType="cq:EditConfig">
<cq:listeners
jcr:primaryType="cq:EditListenersConfig"
updatecomponentlist="function(a,b) {
b.length = 0;
b.push('/apps/my-site/components/content/carousels/imagecarousel');
b.push('/apps/my-site/components/content/carousels/tabbedcarousel');
}"/>
</jcr:root>
3. If your parent component is a parsys, then you can add policies to that parsys within editable templates!
Options 1 or 2, a code deployment must be made if you want to enable or disable sub-components of a component.