Typography is an essential aspect of design, influencing how users perceive and interact with content. In digital interfaces, a well-crafted typography component plays a crucial role in enhancing readability, accessibility, and overall user experience.
npm install @dt-dds/react-typographyTypography is an essential aspect of design, influencing how users perceive and interact with content. In digital interfaces, a well-crafted typography component plays a crucial role in enhancing readability, accessibility, and overall user experience.
``jsx
import { Typography } from '@dt-dds/react-typography';
export const App = () => {
return (
Some text
);
};
`
| Property | Type | Default | Description |
| ------------ | --------------------------------------------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------- |
| children | ReactNode | - | Child components to be rendered |element
| | Elements | p | HTML tag to be rendered |color
| | keyof Theme['colors'] \| keyof Theme['palette'] \| 'unset' \| 'inherit' | content.default | Sets the text color. Supports theme tokens (e.g., grey_100) or contextual keys (e.g., primary.default). |fontStyles
| | keyof Theme['fontStyles']; | - | Applies a predefined theme font style (e.g., 'h1', 'bodyLgBold'). |dataTestId
| | string | typography | A test identifier applied to the element. |style
| | React.CSSProperties | - | Inline styles for custom overrides. |ref
| | RefObject | - | Reference to the underlying DOM node. |...rest
| | ComponentPropsWithoutRef & BaseProps | — | Additional native HTML attributes for the chosen element. |
| |
- TypeScript for static type checking
- React — JavaScript library for user interfaces
- Emotion — for writing css styles with JavaScript
- Storybook — UI component environment powered by Vite
- Jest - JavaScript Testing Framework
- React Testing Library - to test UI components in a user-centric way
- ESLint for code linting
- Prettier for code formatting
- Tsup — TypeScript bundler powered by esbuild
- Yarn from managing packages
- yarn build - Build the packageyarn dev
- - Run the package locallyyarn lint
- - Lint all files within this packageyarn test
- Run all unit tests
Running yarn build from the root of the package will use tsup to compile the raw TypeScript and React code to plain JavaScript.
The /dist folder contains the compiled output.
`bash``
typography
└── dist
├── index.d.ts <-- Types
├── index.js <-- CommonJS version
└── index.mjs <-- ES Modules version
...
Follows semantic versioning
Licensed under MIT License