Divider
The Divider Widget is a simple, horizontal or vertical line that separates content visually within your application's layout. It is primarily used to create a clear distinction between different sections or components, improving the overall readability and organization of the interface. Common use cases include separating items in lists, forms, or between groups of content in both web and mobile applications.
Below is a preview of the Divider in action:
Properties
All customizable properties of the Divider
widget are specified under the styles
object, allowing you to control its appearance, size, orientation, and positioning. These properties enable you to tailor the widget’s look and feel to match your application's design.
Property | Type | Description |
---|---|---|
alignment | string | The alignment of the widget relative to its parent. topLeft , topCenter , topRight , centerLeft , center , centerRight , bottomLeft , bottomCenter , bottomRight . |
captureWebPointer | boolean | Applicable for Web only. When overlaying widgets on top of certain HTML containers (e.g., Maps), the mouse click is captured by the HTML container, causing issues interacting with the widget. Use this to capture and maintain the mouse pointer on your widget. |
color | integer or string | The color specification for the divider, which can be represented in different formats. It can be specified as a number, a predefined color name, or a hexadecimal value starting with '0x'. transparent , black , blue , white , red , grey , teal , amber , pink , purple , yellow , green , brown , cyan , indigo , lime , orange . |
dashLength | number | Specifies the length of the dashes when using the dashed type. Default is 5 . |
direction | string | Whether to display a horizontal divider (default) or vertical divider. |
elevation | integer | The z-coordinate at which to place this material relative to its parent. A non-zero value will show a shadow, with its size relative to the elevation value. Minimum value: 0, Maximum value: 24. |
elevationBorderRadius | string or integer | The border radius of the widget. This can be specified using CSS-like notation with 1 to 4 integers. Minimum value: 0. |
elevationShadowColor | integer or string | The shadow color for the elevation, which can be represented in different formats. It can be specified as a number, a predefined color name, or a hexadecimal value starting with '0x'. transparent , black , blue , white , red , grey , teal , amber , pink , purple , yellow , green , brown , cyan , indigo , lime , orange . |
endIndent | integer | The ending gap after the line ends. |
expanded | boolean | If the parent is a Row or Column, this flag will stretch this widget in the appropriate direction. (e.g., stretch horizontally for parent of type Row). |
gap | number | Specifies the gap between dashes or dots in dashed or dotted divider types. Default is 3 . |
indent | integer | The leading gap before the line starts. |
margin | string or integer | Margin with CSS-style notation, e.g., margin: 5 20 5. |
opacity | number | Adjusts the opacity of the divider line. Values range from 0 (fully transparent) to 1 (opaque). Default is 1 . |
stackPositionBottom | integer | The distance that the child's bottom edge from the bottom of the stack. This is applicable only for Stack's children. |
stackPositionLeft | integer | The distance of the child's left edge from the left of the stack. This is applicable only for Stack's children. |
stackPositionRight | integer | The distance of the child's right edge from the right of the stack. This is applicable only for Stack's children. |
stackPositionTop | integer | The distance of the child's top edge from the top of the stack. This is applicable only for Stack's children. |
thickness | integer | Determines the thickness or width of the divider line within the Divider. Must be a positive integer. Default is 1 . |
type | string | Defines the type of divider line. Options are solid (default), dashed , and dotted . |
visible | boolean | Toggle a widget visibility on/off. Note that an invisible widget will not occupy UI space unless the visibilityTransitionDuration is specified. |
visibilityTransitionDuration | number | Specify the duration in seconds when a widget animates between visible and not visible state. Note that setting this value will cause the widget to still occupy the UI space even when it is not visible. |