retro-react
Version:
A React component library for building retro-style websites
53 lines (52 loc) • 1.74 kB
TypeScript
/** @jsxImportSource theme-ui */
import { CSSProperties } from 'react';
import { ThemeUICSSObject } from 'theme-ui';
import { ComponentColors } from "../../utils/getColorScheme";
export declare type TextVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body1' | 'body2' | 'paragraph' | 'small';
export declare type TextColor = ComponentColors | CSSProperties['color'];
export interface TextProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* The variant of the Text.
*
* @default 'paragraph'
*/
variant?: TextVariant;
/**
* The color of the Text. Supports css color property and theme colors from library.
* Colors included in theme are: `primary`, `secondary`, `success`, `error`, `warn`, `greyscale` and `rainbow`.
*
* @default '#000000'
*/
color?: TextColor;
/**
* Add bevel effect to Text.
*
* @default false
*/
bevel?: boolean;
/**
* Add blink effect to Text.
*
* @default false
*/
blink?: boolean;
/**
* The alignment of the Text.
*
* @default 'left'
*/
align?: CSSProperties['textAlign'];
sx?: ThemeUICSSObject;
}
/**
* Text with different variants. Used instead of HTML tags. Has bevel and blink effects.
* Responsive font sizes are used for all variants. Use `paragraph` variant for generic text blocks.
*
* You can target the `Text` component with the global class `.text-root` in order to change the font family.
*
* @example
* <Text variant="h1">
* Heading 1
* </Text>
*/
export declare const Text: import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<HTMLDivElement>>;