> For AI agents: the complete documentation index is available at /rspress-russian/llms.txt, the full documentation bundle is available at /rspress-russian/llms-full.txt.

# SourceCode

`SourceCode` отображает ссылку на исходный код в репозитории.

## Использование

```mdx title="index.mdx" preview
import { SourceCode } from '@rspress/core/theme';

<SourceCode href="https://github.com/web-infra-dev/rspress/blob/main/packages/core/src/theme/src/components/SourceCode/index.tsx" />
```

Также можно разместить `SourceCode` на одной строке с заголовком. Ссылка на исходный код отобразится в заголовке документа и будет исключена из оглавления, при этом якорь заголовка останется прежним.

```mdx
import { SourceCode } from '@rspress/core/theme';

## Google Analytics <SourceCode href="https://github.com/rstackjs/rspress-plugins" />
```

## Пропсы

```ts
interface SourceCodeProps {
  /** Ссылка на исходный код */
  href: string;
  /** Платформа хостинга кода, определяет, какую иконку отображать */
  platform?: 'github' | 'gitlab';
}
```

Используйте `platform`, чтобы переключаться между иконками GitHub и GitLab. По умолчанию — `'github'`.
