> 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.getresponsivevalues.md).

# rw\.responsiveProps

The `rw.responsiveProps` object contains property values that vary by breakpoint. When a property is marked as responsive in `properties.json`, its per-breakpoint values are accessible here.

## Accessing Responsive Properties

```javascript
const transformHook = (rw) => {
    const { imageFileSize, columnCount } = rw.responsiveProps;
    
    // Each responsive property is an object with breakpoint keys
    console.log(imageFileSize);
    // { base: 400, sm: 600, md: 800, lg: 1200 }
    
    console.log(columnCount);
    // { base: 1, md: 2, lg: 3 }
};

exports.transformHook = transformHook;
```

## Structure

Responsive properties are objects keyed by breakpoint name:

```javascript
{
    base: value,    // Default/mobile value
    sm: value,      // Small screens
    md: value,      // Medium screens
    lg: value,      // Large screens
    xl: value,      // Extra large screens
    "2xl": value    // 2X large screens
}
```

Only breakpoints with explicitly set values are included.

## Example: Responsive Image Sizing

```javascript
const transformHook = (rw) => {
    const { breakpoints } = rw.theme;
    const { imageFileSize } = rw.responsiveProps;
    const { image } = rw.props;
    const { names, screens } = breakpoints;
    
    // Generate srcset for each breakpoint that has a size defined
    const sources = names
        .filter(name => imageFileSize[name] && screens[name])
        .sort((a, b) => screens[b] - screens[a])
        .map(name => ({
            media: `(min-width: ${screens[name]}px)`,
            srcset: rw.resizeResource(image, imageFileSize[name] * 2),
            breakpoint: name
        }));
    
    // Base/fallback size
    const fallbackSrc = rw.resizeResource(image, imageFileSize.base * 2);
    
    rw.setProps({
        sources,
        fallbackSrc
    });
};

exports.transformHook = transformHook;
```

## Example: Responsive Hidden States

```javascript
const transformHook = (rw) => {
    const { hidden } = rw.responsiveProps;
    
    // hidden = { base: true, md: false, lg: false }
    
    // Build visibility classes
    const visibilityClasses = Object.entries(hidden)
        .map(([breakpoint, isHidden]) => {
            const prefix = breakpoint === 'base' ? '' : `${breakpoint}:`;
            return isHidden ? `${prefix}hidden` : `${prefix}block`;
        })
        .join(' ');
    
    rw.setProps({
        visibilityClasses
    });
};

exports.transformHook = transformHook;
```

## Combining with Regular Props

Responsive props complement regular props - use `rw.props` for non-responsive values and `rw.responsiveProps` for breakpoint-specific values:

```javascript
const transformHook = (rw) => {
    // Non-responsive props
    const { image, alt, aspectRatio } = rw.props;
    
    // Responsive props
    const { imageWidth, padding } = rw.responsiveProps;
    
    rw.setProps({
        image,
        alt,
        aspectRatio,
        responsiveWidths: imageWidth,
        responsivePadding: padding
    });
};

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-docs/elements-language/component/hooks.js/available-data/rw.getresponsivevalues.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.
