FormatText

apps/www/src/components/FormatText.astro · 16 lines · group Misc

Used by

No site uses it, neither now nor in the content repos’ history.

Samples 1

synthetic sample — no site uses this component
Plain words, highlighted words in the brand gradient, plain again.
MDX of this sample
<FormatText text="Plain words, *highlighted words* in the brand gradient, plain again." />

Props

NameTypeRequiredDefaultDescription
textstringyes

Source apps/www/src/components/FormatText.astro @ gitt.one

---
interface Props {
  text: string;
}

const { text } = Astro.props;

const chunks = text.split('*');
---

{
  chunks.map((chunk, index) =>
    index % 2 ? <span class="text-primary-600">{chunk}</span> : <span>{chunk}</span>,
  )
}

Source links point to engine-astro@e857a859. Samples are cut from the sites' own content by scripts/gallery-extract.mjs; nothing is merged or removed yet.