Text Color
Use color prop to control the text color of an element.
Name | Styles |
|---|---|
current | |
fg.accent | |
fg.accent.hovered | |
fg.accent.strong | |
fg.avatar.neutral | |
fg.avatar.purple | |
fg.default | |
fg.default.inverse | |
fg.disabled | |
fg.error | |
fg.error.hovered | |
fg.error.light | |
fg.error.strong | |
fg.information | |
fg.information.light | |
fg.information.strong | |
fg.link.default | |
fg.link.default.hovered | |
fg.link.inverse | |
fg.link.subtle | |
fg.link.visited | |
fg.secondary | |
fg.spinner.default | |
fg.spinner.inverse | |
fg.success | |
fg.success.hovered | |
fg.success.light | |
fg.success.strong | |
fg.tertiary | |
fg.warning | |
fg.warning.hovered | |
fg.warning.inverse | |
fg.warning.light | |
fg.warning.strong | |
fg.white | |
transparent |
#
Documentation
#
#
Usage
#
fg.error
The quick brown fox jumps over the lazy dog.
fg.success
The quick brown fox jumps over the lazy dog.
import type { ComponentPropsWithoutRef } from "react";
import { Box, Group, Text } from "@optiaxiom/react";
export function App() {
return (
<Group flexDirection="column" gap="16">
<DemoItem color="fg.error">
The quick brown fox jumps over the lazy dog.
</DemoItem>
<DemoItem color="fg.success">
The quick brown fox jumps over the lazy dog.
</DemoItem>
</Group>
);
}
function DemoItem({
children,
...props
}: ComponentPropsWithoutRef<typeof Box>) {
return (
<div>
<Text color="fg.tertiary" fontFamily="mono" fontWeight="600">
{props.color}
</Text>
<Text fontSize="lg" {...props}>
{children}
</Text>
</div>
);
}Last updated on