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

# SourceCode

`SourceCode` renders a link to repository source code.

## Usage

```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/components/SourceCode/index.tsx" />
```

## Props

```ts
interface SourceCodeProps {
  /** Source code link */
  href: string;
  /** Code hosting platform, determines which icon to display */
  platform?: 'github' | 'gitlab';
}
```

Use `platform` to switch the icon between GitHub and GitLab. Defaults to `'github'`.
