Skip to main content

Typography

Typography component provides a flexible way to display text with various styling options and sizes. It supports different text styles, sizes, and formatting options to create consistent and visually appealing text elements.

Basic Usage

import { Typography } from "@carton-org/react-neumorphism";

<Typography>This is a basic text example</Typography>;

Live Example

This is a basic text example

Props

NameTypeDescriptionRequiredDefault Value
childrenReact.ReactNodeThe content to be displayedYes-
size"xs" | "sm" | "md" | "lg" | "xl"The size of the textNo"md"
boldbooleanWhether the text should be boldNofalse
italicbooleanWhether the text should be italicNofalse
underlinebooleanWhether the text should be underlinedNofalse
ellipsisbooleanWhether to show ellipsis for overflow textNofalse
paragraphbooleanWhether to render as a paragraph elementNofalse
underSizedbooleanWhether to use a smaller size than specifiedNofalse
overSizedbooleanWhether to use a larger size than specifiedNofalse
variantTypographyVariantThe typography variant to useNo-
labelStyleReact.CSSPropertiesCustom CSS styles for the labelNo-

Examples

Different Sizes

Extra Small TextSmall TextMedium TextLarge TextExtra Large Text

Text Styles

Text Styles

Bold TextItalic TextUnderlined Text

Combined Styles

Paragraph and Ellipsis

This is a paragraph text that will wrap to multiple lines. It demonstrates how the paragraph prop affects the text display.

This is a very long text that will be truncated with an ellipsis when it overflows its container.

Size Modifiers

Medium size with underSized modifier

Medium size with overSized modifier