---
title: excerpt
description: 'About `words` words of `content`, centred on the first matched term.'
updated_at: '2026-09-25T10:30:03+02:00'
created_at: '2026-09-25T10:30:03+02:00'
symbol:
  kind: function
  name: excerpt
  signatures:
    - 'excerpt(content: string, terms: readonly string[], words?: number): string'
  parameters:
    - name: content
      type: string
    - name: terms
      type: 'readonly string[]'
    - name: words
      type: number
      optional: true
  returns:
    type: string
  source: >-
    https://github.com/mia-cx/svartz/blob/711f3906a713c8b9a5a572d0f34c85e90c3bc3d1/packages/ui/src/lib/search.ts#L57
---

# excerpt
