1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-17 07:45:52 +01:00
verdaccio/packages/plugins/ui-theme/src/components/Heading.tsx
2021-04-15 21:10:49 +02:00

16 lines
530 B
TypeScript

import { default as MaterialUITypography, TypographyProps } from '@material-ui/core/Typography';
import React, { forwardRef } from 'react';
type HeadingType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
type HeadingRef = HTMLHeadingElement;
interface Props extends Omit<TypographyProps, 'variant'> {
variant?: HeadingType;
}
const Heading = forwardRef<HeadingRef, Props>(function Heading({ variant = 'h6', ...props }, ref) {
return <MaterialUITypography {...props} variant={variant} ref={ref} />;
});
export default Heading;