Skip to component content
Content023 / 155

AttributedText

Mix emphasis, code, and links inside a single text run.

Example

Compose small pieces, add emphasis and inline code, then open the library.

Source
AttributedText.tsxtsx
import { AttributedText } from "@/ohmygui";

export default function Example() {
  return (
    <AttributedText
      as="p"
      runs={[
        "Compose ",
        { text: "small pieces", strong: true },
        ", add ",
        { text: "emphasis", emphasis: true },
        " and ",
        { text: "inline code", code: true },
        ", then ",
        {
          text: "open the library",
          href: "/ohmygui",
          target: "_blank",
        },
        ".",
      ]}
    />
  );
}