Typography
Typography component is a primitive. This means that using this component, you can create any typography variant that is included in the Halstack Design System.
Usage
Use this component only if all other Halstack Design System components for adding text DO NOT meet your requirements. This component should always be the LAST OPTION to use.
| Name | Type | Description | Default |
|---|---|---|---|
| as | 'a' | 'blockquote' | 'cite' | 'code' | 'div' | 'em' | 'figcaption' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'pre' | 'small' | 'span' | 'strong' | Determines the HTML tag with which the text is to be rendered. | 'span' |
Required children | React.ReactNode | Custom text. | - |
| color | string | Color of the text. | 'var(--color-fg-neutral-dark)' |
| display | 'inline' | 'block' | Specifies the display CSS property of the component. | 'inline' |
| fontFamily | string | Specifies the font-family CSS property of the component. | 'var(--typography-font-family)' |
| fontSize | string | Specifies the font-size CSS property of the component. | 'var(--typography-body-m)' |
| fontStyle | 'normal' | 'italic' | Specifies the font-style CSS property of the component. | 'normal' |
| fontWeight | string | Specifies the font-weight CSS property of the component. | 'var(--typography-body-regular)' |
| letterSpacing | string | Specifies the letter-spacing CSS property of the component. | 'var(--spacing-gap-none)' |
| lineHeight | string | Specifies the line-height CSS property of the component. | 'var(--height-s)' |
| textAlign | 'left' | 'center' | 'right' | Specifies the text-align CSS property of the component. | 'left' |
| textDecoration | 'none' | 'underline' | 'line-through' | Specifies the text-decoration CSS property of the component. | 'none' |
| textOverflow | 'clip' | 'ellipsis' | 'unset' | Specifies the text-overflow CSS property of the component. | 'unset' |
| whiteSpace | 'normal' | 'nowrap' | 'pre' | 'pre-line' | 'pre-wrap' | Specifies the white-space CSS property of the component. | 'normal' |
() => { return ( <DxcInset space="var(--spacing-padding-xl)"> <DxcTypography fontFamily="Open Sans, sans-serif"> This DxcTypography component has some children with different styles; parent has a fontFamily 'Open Sans, sans-serif' and{" "} <DxcTypography fontSize="0.75rem" color="#049afd" fontFamily="Source Code Pro, monospace" > one of the children has 'Open Sans, mono-space' and different color and size, </DxcTypography>{" "} <DxcTypography>the other child gets parent's styles.</DxcTypography> </DxcTypography> </DxcInset> ); }