Pallas UI
DocsComponents
Core Concepts
    • Introduction
    • Getting Started
    • Theming
    • Color Tokens
    • Spacing & Sizing
    • Layout Guide
    • AspectRatio
    • Box
    • Flex
    • Grid
    • Shapes
Previews
    • Accordion
    • Alert
    • Avatar
    • Badge
    • Breadcrumb
    • Button
    • Carousel
    • Checkbox
    • Combobox
    • Command
    • Date Picker
    • Form
    • Input
    • Input OTP
    • Label
    • MenuBar
    • Modal
    • Popover
    • Progress
    • Radio Group
    • Segmented
    • Select
    • Separator
    • Sheet
    • Sidebar
    • Skeleton
    • Slider
    • Spinner
    • Steps
    • Switch
    • Tabs
    • Textarea
    • Toast
    • Tooltip
    • Typography
  1. Components
  2. Typography

Typography

A set of text components for displaying content at different levels.

Heading Level 1

This is a standard paragraph with default styling. Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed.

Installation

Copy and paste the following code into your project

import { type Styles, css, cx } from '@styled-system/css'
import { type HeadingVariantMap, heading as headingStyles } from '@styled-system/recipes'
import type React from 'react'
import { type ReactNode, forwardRef } from 'react'
 
type HeadingProps = React.ComponentPropsWithRef<'h1'> & {
  level?: 1 | 2 | 3 | 4 | 5 | 6
  variant?: 'normal' | 'accent'
  color?: 'default' | 'secondary' | 'disabled'
  children: ReactNode
  css?: Styles
}
 
const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(
  ({ level = 1, variant = 'normal', color, children, css: cssProp, ...props }, ref) => {
    const headingStylesRaw = headingStyles({
      level: level as unknown as HeadingVariantMap['level'],
      variant,
      color,
    })
    console.log(headingStylesRaw)
    const headingClassName = cx(headingStylesRaw, css(cssProp || {}))
    const Tag: keyof React.JSX.IntrinsicElements = `h${level}`
 
    return (
      <Tag ref={ref} className={headingClassName} {...props}>
        {children}
      </Tag>
    )
  },
)
 
Heading.displayName = 'Heading'
 
export default Heading
import { styled } from '@styled-system/jsx'
import { paragraph } from '@styled-system/recipes'
 
const Paragraph = styled('p', paragraph)
 
export default Paragraph
import Heading from './heading'
import Paragraph from './paragraph'
export { Heading, Paragraph }

Update the import paths to match your project setup

Usage

import { Heading, Paragraph } from '@/components/ui/typography'
<Heading level={1}>Main Heading</Heading>
<Paragraph>This is a paragraph of text.</Paragraph>

Examples

Heading levels

Heading Level 1

Heading Level 2

Heading Level 3

Heading Level 4

Heading Level 5
Heading Level 6

Heading Variants

Normal Heading

Accent Heading

Heading Colors

Default Color

Secondary Color

Disabled Color

Paragraph Sizes

Base size paragraph. Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed.

Large size paragraph. Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed.

Compact size paragraph. Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed.

Subscript size paragraph. Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed.

Paragraph Colors

Default color paragraph text.

Secondary color paragraph text.

Success color paragraph text.

Warning color paragraph text.

Error color paragraph text.

Disabled color paragraph text.

Paragraph Text Styles

Italic text style.

Bold text style.

Underlined text style.

Paragraph Text Alignments

Left-aligned paragraph. Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed.

Center-aligned paragraph. Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed.

Right-aligned paragraph. Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed.

Justify-aligned paragraph. Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed. This text is justified, which means it is aligned to both the left and right margins.

Built with ❤️ by the carbonteq team. The source code is available on GitHub.

© 2025 Pallas UI. All rights reserved.