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 curved?: boolean
padding?: string padding?: string
background?: string background?: string
width?: string
} }
export default (props: Props) => { export default (props: Props) => {
const boxClass = createMemo(() => (props.curved ? 'curvedbox' : 'box')) const boxClass = createMemo(() => (props.curved ? 'curvedbox' : 'box'))
return ( 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} {props.children}
</section> </section>
) )