> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/elements-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmacsoftware.com/elements-docs/elements-language/component/hooks.js/available-data/rw.project.md).

# rw\.project

The `rw.project` object provides access to project-level settings and metadata.

## Properties

| Property           | Type    | Description                           |
| ------------------ | ------- | ------------------------------------- |
| `title`            | String  | The project title                     |
| `mode`             | String  | Current mode: `"edit"` or `"preview"` |
| `siteUrl`          | String  | The site's base URL                   |
| `language`         | String  | Project language code (e.g., `"en"`)  |
| `enableSocialTags` | Boolean | Whether social tags are enabled       |
| `allowDarkMode`    | Boolean | Whether dark mode is enabled          |
| `logo.url`         | String  | Path to the project logo              |
| `logo.alt`         | String  | Alt text for the project logo         |

## Accessing Project Data

```javascript
const transformHook = (rw) => {
    const { title, mode, siteUrl, language } = rw.project;
    
    console.log(title);    // "My Website"
    console.log(mode);     // "edit" or "preview"
    console.log(siteUrl);  // "https://example.com"
    console.log(language); // "en"
};

exports.transformHook = transformHook;
```

## Edit vs Preview Mode

One of the most common uses is detecting the current mode:

```javascript
const transformHook = (rw) => {
    const { mode } = rw.project;
    
    const isEditMode = mode === 'edit';
    const isPreviewMode = mode === 'preview';
    
    // Show placeholder content in edit mode
    const placeholderImage = isEditMode 
        ? '/path/to/placeholder.png' 
        : null;
    
    rw.setProps({
        isEditMode,
        isPreviewMode,
        placeholderImage
    });
};

exports.transformHook = transformHook;
```

## Accessing the Project Logo

```javascript
const transformHook = (rw) => {
    const { logo, title } = rw.project;
    
    rw.setProps({
        logoUrl: logo.url,
        logoAlt: logo.alt || title,
        hasLogo: !!logo.url
    });
};

exports.transformHook = transformHook;
```

## Passing Project Data to Templates

```javascript
const transformHook = (rw) => {
    rw.setProps({
        project: rw.project
    });
};

exports.transformHook = transformHook;
```

In templates:

```html
<title>{{project.title}}</title>
<html lang="{{project.language}}">

@if(project.logo.url)
    <img src="{{project.logo.url}}" alt="{{project.logo.alt}}">
@endif
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmacsoftware.com/elements-docs/elements-language/component/hooks.js/available-data/rw.project.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
