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

# `__AddInlineStyle`

## Introduction

Adds inline styles to the Element object.

## Syntax

```jsx
__AddInlineStyle(element: Element, id: number, value: string|null|undefined) : void;
```

### Parameters

|   Key   | Description                                                                                                                                                                                                                                                                                                                                  |
| :-----: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| element | Any Element object.                                                                                                                                                                                                                                                                                                                          |
|    id   | A number that corresponds to a style key, for example, 0 corresponds to the style `top`.                                                                                                                                                                                                                                                     |
|  value  | The style value to be set, which can be a string, null, or undefined. When a string is provided, the Lynx SDK will set the corresponding key and value for the Element; if previously set, it will overwrite the previous value. When null or undefined is provided, the Lynx SDK will remove the key from the inline styles of the Element. |

### Return Value

No return value.

## Example

The frontend framework can process the corresponding frontend tags into render directives as shown below.

```jsx
<view src="xxx" style={{ top: '10px' }} />
```

```jsx
// main-thread.js
let element = __CreateElement('view', 0, {});
__SetAttribute(element, 'src', 'xx');

__AddInlineStyle(element, 0, '10px');
```
