> For the complete documentation index, see [llms.txt](https://adospace.gitbook.io/reactorui/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://adospace.gitbook.io/reactorui/guide/components-with-a-state/component-props-and-context.md).

# Component Properties

When creating a component you almost always need to pass props (or parameters/property values) in order to customize its appear or behavior. In ReactorUI you can use plain properties.

Take for example this component that implement an activity indicator with a label:

```csharp
public class BusyComponent : RxComponent
{
    private string _message;
    private bool _isBusy;

    public BusyComponent Message(string message)
    {
        _message = message;
        return this;
    }

    public BusyComponent IsBusy(bool isBusy)
    {
        _isBusy = isBusy;
        return this;
    }

    public override VisualNode Render()
    {
        return new RxStackLayout()
        {
            new RxActivityIndicator()
                .IsRunning(_isBusy),
            new RxLabel()
                .Text(_message)
        };
    }
}
```

and this is how we can use it in a page:

```csharp
public class BusyPageState : IState
{
    public bool IsBusy { get; set; }
}

public class BusyPageComponent : RxComponent<BusyPageState>
{
    protected override void OnMounted()
    {
        SetState(_ => _.IsBusy = true);

        //OnMounted is called on UI Thread, move the slow code to a background thread
        Task.Run(async () =>
        {
            //Simulate lenghty work
            await Task.Delay(3000);

            SetState(_ => _.IsBusy = false);
        });

        base.OnMounted();
    }

    public override VisualNode Render()
    {
        return new RxContentPage()
        {
            State.IsBusy ?
            new BusyComponent()
                .Message("Loading")
                .IsBusy(true)
            :
            RenderPage()
        };
    }

    private VisualNode RenderPage()
        => new RxLabel("Done!")
                .VCenter()
                .HCenter();
}

```

![](/files/-M43NK217f8U1zbemscJ)

**NOTE**: If you need to set properties of components hosted in a different page you should use a Props object (see  [Navigation](/reactorui/guide/components-with-a-state/navigation.md#passing-data-between-pages))


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://adospace.gitbook.io/reactorui/guide/components-with-a-state/component-props-and-context.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
