TitleOnBorder
Reference
- The
TitleOnBordercomponent is a styled<div>. - It is designed to display a title or content with customizable styles, often used in layouts where the title appears on a border or background.
Props
-
marginTop- Type:
string - Description: Sets the top margin of the component.
- Type:
-
marginLeft- Type:
string - Description: Sets the left margin of the component.
- Type:
-
backgroundColor- Type:
string - Description: Sets the background color using the theme's
colorPalette.
- Type:
-
width- Type:
string - Default:
'fit-content' - Description: Sets the width of the component.
- Type:
-
padding- Type:
string - Description: Sets the padding inside the component.
- Type:
-
height- Type:
string - Description: Sets the height of the component.
- Type:
-
lineHeight- Type:
string - Description: Sets the line height of the content.
- Type:
-
display- Type:
string - Description: Sets the CSS
displayproperty (e.g.,flex,block).
- Type:
-
alignItems- Type:
string - Description: Sets the alignment of items if
displayisflex.
- Type:
Usage Example
function Example(pageContext) {
const { protrakComponents } = React.useContext(customWidgetContext);
const { TitleOnBorder } = protrakComponents;
return(
<TitleOnBorder
marginTop="10px"
backgroundColor="PRIMARY"
padding="5px 10px"
lineHeight="1.5"
>
Section Title
</TitleOnBorder>
);
}
- This renders a title with a background color, padding, and custom margins, styled according to the theme.