Font Family
Use fontFamily prop to control the font-family of an element.
Name | Styles |
|---|---|
mono | |
sans |
#
Documentation
#
#
Usage
#
sans
The quick brown fox jumps over the lazy dog.
mono
The quick brown fox jumps over the lazy dog.
import type { ComponentPropsWithoutRef } from "react";
import { Group, Text } from "@optiaxiom/react";
export function App() {
return (
<Group flexDirection="column" gap="16">
<DemoItem fontFamily="sans">
The quick brown fox jumps over the lazy dog.
</DemoItem>
<DemoItem fontFamily="mono">
The quick brown fox jumps over the lazy dog.
</DemoItem>
</Group>
);
}
function DemoItem({
children,
...props
}: ComponentPropsWithoutRef<typeof Text>) {
return (
<div>
<Text color="fg.tertiary" fontFamily="mono" fontWeight="600">
{props.fontFamily}
</Text>
<Text fontSize="xl" fontWeight="500" {...props}>
{children}
</Text>
</div>
);
}Last updated on