> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/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/api-reference/components/hooks.js/available-data/rw.props.md).

# rw\.props

The `rw.props` object contains all the current values from your component's UI controls defined in `properties.json`.

{% hint style="info" %}
Values you pass to `rw.setProps()` won't appear in `rw.props` — it always reflects the UI control values. The best pattern is to read everything you need from `rw.props` at the start of your hook, do your work with local variables, and call `rw.setProps()` at the end.
{% endhint %}

## Accessing Properties

Use destructuring to access individual property values:

```javascript
const transformHook = (rw) => {
    const { title, isVisible, padding, backgroundColor } = rw.props;
    
    // Use the values
    console.log(title);       // "My Component"
    console.log(isVisible);   // true
    console.log(padding);     // 16
};

exports.transformHook = transformHook;
```

## Property Types

The type of each property matches how it's defined in `properties.json`:

| Control Type       | JavaScript Type | Example Value                                             |
| ------------------ | --------------- | --------------------------------------------------------- |
| Text               | `string`        | `"Hello World"`                                           |
| Number / Slider    | `number`        | `42`                                                      |
| Switch             | `boolean`       | `true`                                                    |
| Select / Segmented | `string`        | `"option1"`                                               |
| Color              | `string`        | `"bg-blue-500"`                                           |
| Image / Resource   | `object`        | `{ image: "path/to/image.jpg", width: 800, height: 600 }` |
| Link               | `object`        | `{ href: "/page", title: "Link", target: "_self" }`       |

## Example: Transforming Properties

```javascript
const transformHook = (rw) => {
    const { 
        firstName, 
        lastName, 
        showFullName,
        fontSize 
    } = rw.props;
    
    // Combine properties
    const displayName = showFullName 
        ? `${firstName} ${lastName}` 
        : firstName;
    
    // Transform values
    const fontSizeClass = `text-${fontSize}`;
    
    rw.setProps({
        displayName,
        fontSizeClass
    });
};

exports.transformHook = transformHook;
```

## All Properties Available

Every property defined in your `properties.json` is accessible via `rw.props`. If a property has a `default` value and hasn't been changed, the default value will be returned.

```javascript
const transformHook = (rw) => {
    // Log all available properties
    console.log(rw.props);
    
    // Access any property by its "property" key from properties.json
    const { myCustomProperty } = rw.props;
};

exports.transformHook = transformHook;
```


---

# 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/api-reference/components/hooks.js/available-data/rw.props.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.
