Dapper UI
Download more icon variants from https://tabler-icons.io/i/brand-github View on GitHub
Download more icon variants from https://tabler-icons.io/i/notebook Getting Started
Quick Start (tl;dr)
Installation
Usage
Download more icon variants from https://tabler-icons.io/i/components Components
Button
TextField
Slider
Select
Checkbox
Text
Dialog
Modal
ProgressBar
Meter
Download more icon variants from https://tabler-icons.io/i/bulb Concepts
Theming
Colors
Icons
Styling
Dark Mode
Download more icon variants from https://tabler-icons.io/i/notebook Getting Started
Quick Start (tl;dr)
Installation
Usage
Download more icon variants from https://tabler-icons.io/i/components Components
Button
TextField
Slider
Select
Checkbox
Text
Dialog
Modal
ProgressBar
Meter
Download more icon variants from https://tabler-icons.io/i/bulb Concepts
Theming
Colors
Icons
Styling
Dark Mode

Text

import { Text } from "@dapper-ui/core";
The Text component allows you to customize the font size, weight, color, contrast, and line height to fit your design needs. You can change the HTML tag to optimize the text's semantics and accessibility. This component is particularly useful when using dark mode, as it automatically adjusts the text color to match the current mode.

Demo

Dapper UI is amazing!
Color
1
2
3
<Text>
    Dapper UI is amazing!
</Text>

Props

Text

contrast

Type
'highest' | 'higher' | 'high' | 'base' | 'low' | 'lower' | 'lowest' | undefined
Default Value
'base'

The contrast of the text.

Uses different shades of the color to achieve the desired contrast. The used shade depends on whether or not dark mode is enabled.

color

Type
string | undefined
Default Value
'neutral'

The color of the text.

Default to the neutral color shade.

size

Type
'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl'
Default Value
'base'

The size of the text.

weight

Type
'thin' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black'
Default Value
'normal'

The font weight of the text.

Please note that not all fonts support all weights, in which case the closest weight will be used by the browser.

lineHeight

Type
'none' | 'tight' | 'snug' | 'normal' | 'relaxed' | 'loose' | undefined
Default Value
undefined

The line height of the text.

tag

Type
'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | string
Default Value
'span'

The HTML tag to use for the text.

This does not affect the styling of the text, but should be set for semantic reasons to improve accessibility and SEO.

Defaults to span.

prose

Type
boolean
Default Value
false

Whether or not to use the width of the text should be limited to about 65 characters. This improves readability of longer texts that span multiple lines.

Requires a non-inline style (e.g., by setting the tag to div).

Defaults to false.

truncate

Type
boolean
Default Value
false

Whether or not to truncate the text to a single line (using the ellipsis overflow style).

style

Type
string | undefined
Default Value
undefined

Custom CSS styles to apply.

Especially useful for positioning styles like margings.