> 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.

# LastUpdated

`LastUpdated` displays the page's last updated time, and optionally the last author. Typically used with the theme's `lastUpdated` configuration.

## Usage

```tsx preview
import { LastUpdated as BasicLastUpdated } from '@rspress/core/theme-original';

export default function LastUpdated() {
  return <BasicLastUpdated />;
}
```

This component doesn't accept any props and automatically reads the last updated time from page metadata.

## Related configuration

Enable `lastUpdated` in `rspress.config.ts`:

```ts title="rspress.config.ts"
import { defineConfig } from '@rspress/core';

export default defineConfig({
  themeConfig: {
    lastUpdated: true,
  },
});
```

When `lastUpdated` is enabled, the component automatically reads and formats the page metadata.

### Displaying the author

Configure `lastUpdated.author` to display the last commit author:

```ts title="rspress.config.ts"
export default defineConfig({
  themeConfig: {
    lastUpdated: {
      // Show the commit author's name:
      // author: true,

      // Or use custom display text:
      author: ({ name, email }) => `${name} <${email}>`,
    },
  },
});
```

The callback receives `{ name, email, filePath }` (the commit author info from `git log` and the source file path) and returns the string to render.

To customize the display text or time format, you can export and modify `theme/components/LastUpdated/index.tsx` using `rspress eject LastUpdated`.
