aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/forms/legend/legend.tsx
blob: b517855d92272ea4b7dd2e3936ef68233f8c40b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import type { FC, HTMLAttributes } from 'react';
import styles from './legend.module.scss';

export type LegendProps = HTMLAttributes<HTMLLegendElement>;

/**
 * Legend component.
 */
export const Legend: FC<LegendProps> = ({
  children,
  className = '',
  ...props
}) => {
  const legendClass = `${styles.legend} ${className}`;

  return (
    <legend {...props} className={legendClass}>
      {children}
    </legend>
  );
};