1e41f4b71Sopenharmony_ci# divider 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci> **NOTE** 4e41f4b71Sopenharmony_ci> 5e41f4b71Sopenharmony_ci> This component is supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version. 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ciThe **\<divider>** component is used to separate content blocks and content elements. It can be used for the list or UI layout. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## Required Permissions 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ciNone 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci## Child Components 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ciNot supported 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci## Attributes 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ciIn addition to the [universal attributes](js-components-common-attributes.md), the following attributes are supported. 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci| Name | Type | Default Value | Mandatory | Description | 24e41f4b71Sopenharmony_ci| -------- | ------- | ----- | ---- | -------------------- | 25e41f4b71Sopenharmony_ci| vertical | boolean | false | No | Whether to use the vertical divider. The default value is **false**, indicating that the horizontal divider is used.| 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci> **NOTE** 28e41f4b71Sopenharmony_ci> 29e41f4b71Sopenharmony_ci> The **focusable** and **disabled** attributes are not supported. 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci## Styles 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ciOnly the following styles are supported. 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ci| Name | Type | Default Value | Mandatory | Description | 37e41f4b71Sopenharmony_ci| --------------------------------- | -------------- | ---------- | ---- | ---------------------------------------- | 38e41f4b71Sopenharmony_ci| margin | <length> | 0 | No | Shorthand attribute to set the margin for all sides in a declaration. The attribute can have one to four values. | 39e41f4b71Sopenharmony_ci| margin-[left\|top\|right\|bottom] | <length> | 0 | No | Shorthand attribute of the length type to set left, top, right, and bottom margins attributes. Its unit is px and default value is **0**.| 40e41f4b71Sopenharmony_ci| color | <color> | \#08000000 | No | Color of the divider. | 41e41f4b71Sopenharmony_ci| stroke-width | <length> | 1 | No | Width of the divider. | 42e41f4b71Sopenharmony_ci| display | string | flex | No | Type of the bounding box generated by the divider. The value can be **flex** or **none**. The default value is **flex**. | 43e41f4b71Sopenharmony_ci| visibility | string | visible | No | Whether to display the divider. Invisible dividers also occupy space. **visible** indicates that the divider is displayed, and **hidden** indicates that the divider is not displayed.| 44e41f4b71Sopenharmony_ci| line-cap | string | butt | No | Cap style of the divider. The default value is **butt**. Available values are as follows:<br>- **butt**: The ends of the divider are squared off.<br>- **round**: A rounded cap is added to each end of the divider. The divider length will increase by the stroke width.<br>- **square**: A square cap is added to each end of the divider. The divider length will increase by the stroke width.| 45e41f4b71Sopenharmony_ci| flex | number | - | No | How to divide available space of the parent component for each child component. This is a shorthand attribute to set the **flex-grow** attribute.<br>This attribute takes effect only when the parent component is **\<div>**, **\<list-item>**, or **\<tabs>**.| 46e41f4b71Sopenharmony_ci| flex-grow | number | 0 | No | How much a child component will grow. The value specifies allocation of the available space on the main axis of the parent component. Size of available space = Container size - Total size of all child components. Value **0** indicates that the child component does not grow.<br>This attribute takes effect only when the parent component is **\<div>**, **\<list-item>**, or **\<tabs>**.| 47e41f4b71Sopenharmony_ci| flex-shrink | number | 1 | No | How much a child component will shrink. The shrink occurs only when the sum of default element widths is greater than that of the parent component. Value **0** indicates that the child component does not shrink.<br>This attribute takes effect only when the parent component is **\<div>**, **\<list-item>**, or **\<tabs>**.| 48e41f4b71Sopenharmony_ci| flex-basis | <length> | - | No | Initial length of a child component on the main axis.<br>This attribute takes effect only when the parent component is **\<div>**, **\<list-item>**, or **\<tabs>**.| 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ci## Events 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ciNot supported 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ci## Methods 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_ciNot supported 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci 61e41f4b71Sopenharmony_ci## Example 62e41f4b71Sopenharmony_ci 63e41f4b71Sopenharmony_ci```html 64e41f4b71Sopenharmony_ci<!-- xxx.hml --> 65e41f4b71Sopenharmony_ci<div class="container"> 66e41f4b71Sopenharmony_ci <div class="content"> 67e41f4b71Sopenharmony_ci <divider class="divider" vertical="false"></divider> 68e41f4b71Sopenharmony_ci </div> 69e41f4b71Sopenharmony_ci</div> 70e41f4b71Sopenharmony_ci``` 71e41f4b71Sopenharmony_ci 72e41f4b71Sopenharmony_ci```css 73e41f4b71Sopenharmony_ci/* xxx.css */ 74e41f4b71Sopenharmony_ci.container { 75e41f4b71Sopenharmony_ci margin: 20px; 76e41f4b71Sopenharmony_ci flex-direction:column; 77e41f4b71Sopenharmony_ci width:100%; 78e41f4b71Sopenharmony_ci height:100%; 79e41f4b71Sopenharmony_ci align-items:center; 80e41f4b71Sopenharmony_ci} 81e41f4b71Sopenharmony_ci.content{ 82e41f4b71Sopenharmony_ci width:80%; 83e41f4b71Sopenharmony_ci height:40%; 84e41f4b71Sopenharmony_ci border:1px solid #000000; 85e41f4b71Sopenharmony_ci align-items: center; 86e41f4b71Sopenharmony_ci justify-content: center; 87e41f4b71Sopenharmony_ci flex-direction:column; 88e41f4b71Sopenharmony_ci} 89e41f4b71Sopenharmony_ci.divider { 90e41f4b71Sopenharmony_ci margin: 10px; 91e41f4b71Sopenharmony_ci color: #ff0000ff; 92e41f4b71Sopenharmony_ci stroke-width: 3px; 93e41f4b71Sopenharmony_ci line-cap: round; 94e41f4b71Sopenharmony_ci} 95e41f4b71Sopenharmony_ci``` 96e41f4b71Sopenharmony_ci 97e41f4b71Sopenharmony_ci 98