Added width props on box component

This commit is contained in:
Patrick Alvin Alcala 2025-11-05 10:38:09 +08:00
parent 73ac0ae2d1
commit bc67d9a445

View file

@ -8,13 +8,14 @@ interface Props {
curved?: boolean
padding?: string
background?: string
width?: string
}
export default (props: Props) => {
const boxClass = createMemo(() => (props.curved ? 'curvedbox' : 'box'))
return (
<section class={boxClass()} style={`border: ${props.thickness}px solid ${props.color || 'white'}; padding: ${props.padding || 0}; background-color: ${props.background || 'none'}`}>
<section class={boxClass()} style={`border: ${props.thickness}px solid ${props.color || 'white'}; padding: ${props.padding || 0}; background-color: ${props.background || 'none'}; width: ${props.width || 'auto'}`}>
{props.children}
</section>
)