import "hono/jsx" import type { FC, PropsWithChildren, JSX } from "hono/jsx" import { CodeExamples } from "./code" import { cn } from "./cn" type BoxProps = JSX.IntrinsicElements["div"] & PropsWithChildren & { bg?: string color?: string p?: number } export const Box: FC = (props) => { const { children, bg, color, p, class: className, style, id, ref, ...rest } = props const boxStyle: JSX.CSSProperties = { backgroundColor: bg, color: color, padding: p ? `${p}px` : undefined, ...(style as JSX.CSSProperties), } return
{children}
} // Common demo box colors export const RedBox: FC = ({ children }) => ( {children} ) export const GreenBox: FC = ({ children }) => ( {children} ) export const BlueBox: FC = ({ children }) => ( {children} ) export const GrayBox: FC = ({ children, style }) => ( {children} ) export const Test = () => { return (
{/* API Usage Examples */} Content', 'Content', 'Content', 'Content', ]} />

Box Component

Basic Box with custom background and text color Box with padding and border

Color Variants

Red Box Green Box Blue Box Gray Box

Nested Boxes

Nested boxes demonstration
) }