Interlock box component
🔗 children ▪️ padding ▪️ margin ▪️ css ▪️ className
export interface BoxProps {
children: React.ReactNode | ReactNode[]
padding?: 'small' | 'medium' | 'large' | 'x-large' | 'none'
margin?: 'small' | 'medium' | 'large' | 'x-large' | 'none'
css?: React.CSSProperties;
className?: string;
onClick?: MouseEventHandler<HtmlDivElement>;}
<>
<Box css={{ backgroundColor: 'gray' }}>
<Text text="Children example usage usage" />
</Box>
</>
Rendered outputChildren example usage usage
<>
<Box padding="small" css={{ backgroundColor: 'gray' }}>
<Text text="Small padding usage" />
</Box>
<hr />
<Box padding="medium" css={{ backgroundColor: 'gray' }}>
<Text text="Medium padding usage" />
</Box>
<hr />
<Box padding="large" css={{ backgroundColor: 'gray' }}>
<Text text="Large padding usage" />
</Box>
<hr />
<Box padding="x-large" css={{ backgroundColor: 'gray' }}>
<Text text="X-lage padding usage" />
</Box>
</>
Rendered outputSmall padding usage
Medium padding usage
Large padding usage
X-lage padding usage
<>
<Box margin="small" css={{ backgroundColor: 'gray' }}>
<Text text="Small margin usage" />
</Box>
<hr />
<Box margin="medium" css={{ backgroundColor: 'gray' }}>
<Text text="Small margin usage" />
</Box>
<hr />
<Box margin="large" css={{ backgroundColor: 'gray' }}>
<Text text="Small margin usage" />
</Box>
<hr />
<Box margin="x-large" css={{ backgroundColor: 'gray' }}>
<Text text="Small margin usage" />
</Box>
</>
Rendered outputSmall margin usage
Small margin usage
Small margin usage
Small margin usage
<>
<Box css={{ backgroundColor: 'red' }}>
<Text text="Css example usage" />
</Box>
</>
Rendered output
<>
<Box className="my-classname">
<Text text="Class name example usage" />
</Box>
</>
Rendered outputChildren example usage usage