Data Displayduskmoonimplemented8 demos

Typography

Typography standardizes text, title, paragraph, link, copy, edit, and ellipsis behavior.

Import@duskmoon-dev/components/typography
22API sections
41documented props
6behavior scenarios
Key API
editingicontooltiptriggerTypeenterIcontext

Usage

When to use

  • Use it to clarify state, metadata, content hierarchy, or loading without creating a new workflow.
  • Pair it with semantic content so visual treatment never becomes the only source of meaning.

Implementation notes

StylesheetImport @duskmoon-dev/components/styles.css once in the app or docs shell.
StateStart with default props for static examples, then switch to controlled props when state must be shared.
ThemeThe preview inherits the active DuskMoon data-theme value from the docs layout.

Features

Visual hierarchy

Focuses on status, metadata, empty/loading states, or content grouping without owning application state.

Theme integration

Uses DuskMoon tokens so the component follows the active docs theme.

Primary API surface

Typography is most often configured through `editing`, `icon`, `tooltip`, `triggerType`.

Covered behavior

Renders root and semantic text states

Feature Demos

Feature demos are authored for the component page, then supplemented with behavior scenarios from the component test coverage.

Preview
DuskMoon Typography

Basic usage

authored

Import the component stylesheet and Typography from its package subpath, then render it with the core props.

Source
import "@duskmoon-dev/components/styles.css";
import { Typography } from "@duskmoon-dev/components/typography";

export function Example() {
  return (<Typography>DuskMoon Typography</Typography>);
}
Preview
DuskMoon Typography

Renders root and semantic text states

test-backed

Typography scenario from the component test coverage: renders root and semantic text states.

Source
import "@duskmoon-dev/components/styles.css";
import { Typography } from "@duskmoon-dev/components/typography";

export function TypographyRendersRootAndSemanticDemo() {
  return (<Typography>DuskMoon Typography</Typography>);
}
Preview
DuskMoon Typography

Renders title level, paragraph, and link

test-backed

Typography scenario from the component test coverage: renders title level, paragraph, and link.

Source
import "@duskmoon-dev/components/styles.css";
import { Typography } from "@duskmoon-dev/components/typography";

export function TypographyRendersTitleLevelParagraphDemo() {
  return (<Typography>DuskMoon Typography</Typography>);
}
Preview
DuskMoon Typography

Supports copyable text

test-backed

Typography scenario from the component test coverage: supports copyable text.

Source
import "@duskmoon-dev/components/styles.css";
import { Typography } from "@duskmoon-dev/components/typography";

export function TypographySupportsCopyableTextDemo() {
  return (<Typography>DuskMoon Typography</Typography>);
}
Preview
DuskMoon Typography

Supports editable text save and cancel

test-backed

Typography scenario from the component test coverage: supports editable text save and cancel.

Source
import "@duskmoon-dev/components/styles.css";
import { Typography } from "@duskmoon-dev/components/typography";

export function TypographySupportsEditableTextSaveDemo() {
  return (<Typography>DuskMoon Typography</Typography>);
}
Preview
DuskMoon Typography

Supports expandable ellipsis

test-backed

Typography scenario from the component test coverage: supports expandable ellipsis.

Source
import "@duskmoon-dev/components/styles.css";
import { Typography } from "@duskmoon-dev/components/typography";

export function TypographySupportsExpandableEllipsisDemo() {
  return (<Typography>DuskMoon Typography</Typography>);
}
Preview
DuskMoon Typography

Prevents disabled link navigation

test-backed

Typography scenario from the component test coverage: prevents disabled link navigation.

Source
import "@duskmoon-dev/components/styles.css";
import { Typography } from "@duskmoon-dev/components/typography";

export function TypographyPreventsDisabledLinkNavigationDemo() {
  return (<Typography>DuskMoon Typography</Typography>);
}
Preview
Sunshine Theme
DuskMoon Typography
Moonlight Theme
DuskMoon Typography

Theme aware

authored

Docs previews inherit the DuskMoon data-theme value. Use the header switch to compare light and dark rendering.

Source
<div data-theme="sunshine">
  <Typography>DuskMoon Typography</Typography>
</div>

<div data-theme="moonlight">
  <Typography>DuskMoon Typography</Typography>
</div>

API

The API reference below lists every parsed exported type or interface for Typography. Start with `editing`, `icon`, `tooltip`, `triggerType` for common usage.

Types: packages/components/src/components/typography/Typography.types.tsScenarios: packages/components/src/components/typography/Typography.test.tsx
TypographyEditableConfiginterface
PropTypeRequiredDescription
editingbooleanNoediting configures Typography.
iconReactNodeNoicon configures Typography.
tooltipReactNodeNotooltip configures Typography.
triggerType"icon" | "text" | Array<"icon" | "text">NotriggerType configures Typography.
enterIconReactNodeNoenterIcon configures Typography.
textstringNotext configures Typography.
maxLengthnumberNomaxLength configures Typography.
autoSizeboolean | { minRows?: number; maxRows?: number }NoautoSize configures Typography.
onStart() => voidNoonStart configures Typography.
onChange(value: string) => voidNoonChange configures Typography.
onCancel() => voidNoonCancel configures Typography.
onEnd() => voidNoonEnd configures Typography.
TypographyCopyableConfiginterface
PropTypeRequiredDescription
textstringNotext configures Typography.
iconReactNode | [ReactNode, ReactNode]Noicon configures Typography.
tooltipsfalse | ReactNode | [ReactNode, ReactNode]Notooltips configures Typography.
formatTypographyCopyFormatNoformat configures Typography.
onCopy(event?: ClipboardEvent | React.MouseEvent<HTMLElement>) => voidNoonCopy configures Typography.
TypographyEllipsisConfiginterface
PropTypeRequiredDescription
rowsnumberNorows configures Typography.
expandableboolean | "collapsible"Noexpandable configures Typography.
suffixstringNosuffix configures Typography.
symbolReactNode | ((expanded: boolean) => ReactNode)Nosymbol configures Typography.
tooltipReactNodeNotooltip configures Typography.
onExpand(NoonExpand configures Typography.
eventReact.MouseEvent<HTMLElement>,Yesevent configures Typography.
info{ expanded: boolean },Yesinfo configures Typography.
onEllipsis(ellipsis: boolean) => voidNoonEllipsis configures Typography.
TypographySemanticPropsinterface
PropTypeRequiredDescription
typeTypographyStatusNotype configures Typography.
disabledbooleanNodisabled configures Typography.
markbooleanNomark configures Typography.
codebooleanNocode configures Typography.
keyboardbooleanNokeyboard configures Typography.
underlinebooleanNounderline configures Typography.
deletebooleanNodelete configures Typography.
strongbooleanNostrong configures Typography.
italicbooleanNoitalic configures Typography.
TypographyBehaviorPropsinterface
PropTypeRequiredDescription
editableTypographyEditableNoeditable configures Typography.
copyableTypographyCopyableNocopyable configures Typography.
ellipsisTypographyEllipsisNoellipsis configures Typography.
TextPropsinterface extends Omit<ComponentProps<"span">, "color">, TypographySemanticProps, TypographyBehaviorProps
PropTypeRequiredDescription
sizeTypographySizeNosize configures Typography.
ParagraphPropsinterface extends Omit<ComponentProps<"p">, "color">, TypographySemanticProps, TypographyBehaviorProps
No direct props declared.
TitlePropsinterface extends Omit<ComponentProps<"h1">, "color">, TypographySemanticProps, TypographyBehaviorProps
PropTypeRequiredDescription
levelTypographyLevelNolevel configures Typography.
LinkPropsinterface extends Omit<ComponentProps<"a">, "color" | "type">, TypographySemanticProps
PropTypeRequiredDescription
ellipsisTypographyEllipsisNoellipsis configures Typography.
TypographyStatustype
"secondary" | "success" | "warning" | "danger"
TypographySizetype
"sm" | "md" | "lg"
TypographyLeveltype
1 | 2 | 3 | 4 | 5
TypographyCopyFormattype
"text/plain" | "text/html"
TypographyEditabletype
boolean | TypographyEditableConfig
TypographyCopyabletype
boolean | TypographyCopyableConfig
TypographyEllipsistype
boolean | TypographyEllipsisConfig
TypographyPropstype
ComponentProps<"div">
TextComponenttype
ForwardRefExoticComponent< TextProps & RefAttributes<HTMLSpanElement> >
ParagraphComponenttype
ForwardRefExoticComponent< ParagraphProps & RefAttributes<HTMLParagraphElement> >
TitleComponenttype
ForwardRefExoticComponent< TitleProps & RefAttributes<HTMLHeadingElement> >
LinkComponenttype
ForwardRefExoticComponent< LinkProps & RefAttributes<HTMLAnchorElement> >
TypographyComponenttype
ForwardRefExoticComponent< TypographyProps & RefAttributes<HTMLDivElement> > & { Text: TextComponent