@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
32 lines (31 loc) • 1.3 kB
TypeScript
import { HTMLAttributes, JSX } from 'react';
import { Theme } from '../../types';
import { TextSize, TextTag, TextWeight } from './Text.utils';
export interface TextProps extends HTMLAttributes<HTMLQuoteElement | HTMLDivElement | HTMLLegendElement | HTMLParagraphElement | HTMLSpanElement | HTMLTimeElement> {
/** Content of the text. */
children: React.ReactNode;
/** Size of the text.
* @default 'medium'
*/
size?: TextSize;
/** Specifies the HTML tag to be used for the text.
* @default 'p'
*/
tag?: TextTag;
/** Defines the theme.
* @default 'light'
*/
theme?: Theme;
/** Defines the weight, `size='xx-small'` does not have a bold variant.
* @default 'normal'
*/
weight?: TextWeight;
}
/**
* The `DSText` component is designed for displaying body text and paragraphs,
* ensuring consistent sizing across different viewports.
* It is a versatile component that can be used in various parts of your application where text content is needed.
*
* Design in Figma: [Text](https://www.figma.com/design/d9wrOp4aCplDsV9AVC87Xn/Typography-%F0%9F%85%B0%EF%B8%8F?node-id=3-2301&t=TeSgud7dB5pnld5s-11)
*/
export declare const DSText: ({ children, className, size, tag, theme, weight, ...rest }: TextProps) => JSX.Element;