mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
31 lines
630 B
TypeScript
31 lines
630 B
TypeScript
import React from 'react';
|
|
import { clsx } from 'clsx';
|
|
|
|
export interface KbdProps extends React.HTMLAttributes<HTMLElement> {
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
/**
|
|
* Keyboard shortcut display component
|
|
*/
|
|
export const Kbd = React.forwardRef<HTMLElement, KbdProps>(
|
|
({ children, className, ...props }, ref) => {
|
|
return (
|
|
<kbd
|
|
ref={ref}
|
|
className={clsx(
|
|
'px-2 py-1 text-xs font-semibold',
|
|
'bg-muted border border-border rounded',
|
|
'shadow-sm',
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</kbd>
|
|
);
|
|
}
|
|
);
|
|
Kbd.displayName = 'Kbd';
|
|
|