Background Color
Use bg prop to control the background color of an element.
Name | Styles |
|---|---|
bg.accent | |
bg.accent.hovered | |
bg.accent.light | |
bg.accent.pressed | |
bg.accent.subtle | |
bg.avatar.neutral | |
bg.avatar.purple | |
bg.default | |
bg.default.hovered | |
bg.default.inverse | |
bg.default.inverse.hovered | |
bg.default.inverse.pressed | |
bg.default.pressed | |
bg.error | |
bg.error.hovered | |
bg.error.light | |
bg.error.pressed | |
bg.error.subtle | |
bg.error.subtlest | |
bg.information | |
bg.information.light | |
bg.information.subtle | |
bg.overlay | |
bg.page | |
bg.secondary | |
bg.secondary.hovered | |
bg.spinner.default | |
bg.spinner.inverse | |
bg.success | |
bg.success.hovered | |
bg.success.light | |
bg.success.subtle | |
bg.tertiary | |
bg.tertiary.hovered | |
bg.warning | |
bg.warning.hovered | |
bg.warning.light | |
bg.warning.subtle | |
current | |
transparent |
#
Documentation
#
#
Usage
#
bg=bg.success.light
bg=bg.warning.light
import type { ComponentPropsWithoutRef } from "react";
import { Box, Group } from "@optiaxiom/react";
export function App() {
return (
<Group
alignItems="center"
flexDirection={["column", "row"]}
gap="16"
justifyContent="space-around"
w="full"
>
<DemoBox bg="bg.success.light">bg=bg.success.light</DemoBox>
<DemoBox bg="bg.warning.light">bg=bg.warning.light</DemoBox>
</Group>
);
}
function DemoBox({ children, ...props }: ComponentPropsWithoutRef<typeof Box>) {
return (
<Box
display="grid"
fontFamily="mono"
fontSize="md"
fontWeight="600"
p="16"
placeItems="center"
rounded="sm"
{...props}
>
{children}
</Box>
);
}Last updated on