# Component Selector
UIExtension provides a css-selector like syntax to make easier to search components.
It's usually used to configure the target property of fragments and component search.
# Syntax
| selector name | example | description | 
|---|---|---|
| name selector | 'componentName', 'component_name','component-name', 'component-name1', '1component' | component name selectors can only include single-letter, number, underscore or minus character | 
| type selector | '@div','@dropdown-menu', '@print:print-dialog' | component type means the tag name defined in layout template, a type selector should start with @character and single-letter, number, underscore or minus. some time including the component module name sparated with colon character. | 
| star selector | '*' | Selects all components | 
| children selector | 'selector1>selector2' | Selects all components which match selector2where the parent isselector1 | 
| descendants | 'selector1 selector2' | Selects all selector2components insideselector1 | 
| attribute selector | [attr=value] | Selects all components with property or attribute name of attrwhose value equals tovalue | 
| attribute selector | [attr^=value] | Selects all components with property or attribute name of attrwhose value begins withvalue | 
| attribute selector | [attr$=value] | Selects all components with property or attribute name of attrwhose value ends withvalue | 
| attribute selector | [attr*=value] | Selects all components with property or attribute name of attrwhose value contains withvalue | 
| attribute selector | [attr!=value] | Selects all components with property or attribute name of attrwhose value not equals tovalue | 
| method selector | selector1::childAt(index) | Selects all components that are all the child at indexof their parents selected byselector1 | 
| method selector | selector1::parent() | Selects all components that are all the parent component of their children selected by selector1 | 
| method selector | selector1::allAfter() | Selects all components of the same level that after the component set selected by selector1 | 
| method selector | selector1::allBefore() | Selects all components of the same level that before the component set selected by selector1 | 
| index-related selector | selector1::eq(index) | Selects the component by index value in components set selected by selector1 | 
| index-related selector | selector1::last() | Selects the last one component of the components set selected by selector1 | 
| index-related selector | selector1::first() | Selects the first one component of the components set selected by selector1, It's equivalent toselector1:eq(0) | 
# Examples
← UI fragments I18N →