'use client';
import { forwardRef, HTMLAttributes } from 'react';
import styles from './marginalia.module.css';
export interface MarginaliaProps extends HTMLAttributes {
/** Note content */
children: string;
/** Note position */
position?: 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
/** Note style */
style?: 'pencil' | 'ink' | 'highlighter' | 'sticker';
/** Note rotation */
rotation?: number;
/** Show arrow pointing to text */
showArrow?: boolean;
/** Note label/prefix */
label?: string;
}
export const Marginalia = forwardRef(
(
{
children,
position = 'right',
style: noteStyle = 'pencil',
rotation = -5,
showArrow = true,
label,
className,
...props
},
ref
) => {
return (
{label && {label}}
{children}
{showArrow && →}
);
}
);
Marginalia.displayName = 'Marginalia';
export default Marginalia;