@abbl/material-calendar
Version:
Calendar component build with React and Material-UI
55 lines (54 loc) • 1.37 kB
TypeScript
import React, { ReactElement } from 'react';
export interface DateAvatarProps {
/**
* Number of the day that will be rendered inside of the avatar.
*
* //TODO: Add support for number type.
*/
date: Date;
/**
* Highlights component when mouse hovers over it.
*
* @default false
*/
highlightOnHover?: boolean;
/**
* If set to true, text color will be set to gray.
*
* @default false
*/
grayOutText?: boolean;
/**
* If set to true, text will be rendered using
* div instead of typography component.
*
* @default false
*/
plainText?: boolean;
/**
* Size variant.
*
* @default 'large'
*/
size?: 'small' | 'large';
/**
* Disables today background variant.
*
* @default false
*/
disableTodayBackground?: boolean;
/**
* Triggered whenever user clicks on the component.
*/
onClick?: (event: React.MouseEvent<any>, date: Date) => void;
}
/**
* Component based on Avatar design of Material-UI.
*
* Created due default Avatar component being too heavy to render in YearView,
* which degraded the performance significantly.
*
* @privateRemarks
* Remember to keep this component as lightweight as you can.
*/
export default function DateAvatar(props: DateAvatarProps): ReactElement;