Zoeken...  ⌘K GitHub

TextCaption text

Bijschrift tekst met bronvermelding.

/text-caption
src/components/text/TextCaption.astro
---
interface Props {
  text: string;
  source?: string;
}
const { text = "Ons team tijdens de lancering van de BLURR Growth Sprint, april 2025.", source = "Foto: BLURR archief" } = Astro.props;
---

<figure class="tx-cap">
  <figcaption class="tx-cap__caption">
    <span class="tx-cap__text">{text}</span>
    {source && <span class="tx-cap__source">{source}</span>}
  </figcaption>
</figure>

<style>
  :root {
    --color-accent: #6366f1;
    --color-primary: #0a0a0a;
  }
  .tx-cap {
    margin: 0;
    padding: 0.6rem 0 0;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
  }
  .tx-cap__caption {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.5rem;
    width: 100%;
  }
  .tx-cap__text {
    font-size: 0.825rem;
    color: #666;
    line-height: 1.5;
    font-style: italic;
  }
  .tx-cap__source {
    font-size: 0.75rem;
    color: #bbb;
    white-space: nowrap;
    flex-shrink: 0;
  }
</style>

Props

Prop Type Default Beschrijving
text * string Bijschrift tekst
source string Bron

* = verplicht