Skip to Content
Font Family

Font Family

Use fontFamily prop to control the font-family of an element.

Name

Styles

heading
mono
sans

Documentation

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> ); }

A

a

Typography

The type scale, and which component renders each style. Start here before reaching for font props.

A

a

Fonts

Licensed brand fonts for Optimizely staff. Third parties fall back to free web fonts automatically.

Last updated on