Create Your First View

Create a React view component and register it as a UI component.


1. Create a View Component

Create your first view in src/views/:

// src/views/portfolio/PortfolioView.tsx
import { ObjectSearchComponent, useExecuteRequestCallback,useUXPContext } from "uxp/components";
import { YourAppServices } from "../../services";

const PortfolioView = ({ }) => {
    const uxpContext = useUXPContext();
    const executeGetAll = useExecuteRequestCallback(
        YourAppServices.getAll()
    );

    const getAll = async (page, pageSize, query, filters, sort) => {
        const params = { page, pageSize, q: query, ...filters };
        const { data } = await executeGetAll(params);
        return { items: data || [] };
    };

    const columns = [
        {
            id: 'Name',
            label: 'Name',
            isSortable: true
        },
        {
            id: 'Status',
            label: 'Status'
        }
    ];

    return (
        <ObjectSearchComponent
            data={getAll}
            idField="Key"
            columns={columns}
            pageSize={50}
        />
    );
};

export default PortfolioView;

2. Register the View as UI

In src/index.tsx, register your view:

UI vs Widget Registration

Use registerUI() for views (pages):

Use registerWidget() only for dashboard widgets:

Why registerUI()?

  • ✅ Designed for full-page views

  • ✅ Better for v5 architecture

  • ✅ Recommended by framework

  • ✅ To avoid clutter in widgets list.


3. Update bundle.json

Add your UI component to bundle.json:

Key Points:

  • id - Bundle identifier (format: iviva-<appname>-app)

  • uis array - List all UI components registered with window.registerUI()

  • Each UI entry needs: id, label, description

  • The id must match the ID used in window.registerUI()


4. Build Your View

Your view is now compiled to dist/main.js.


Next Steps

Your view is created but not yet accessible. Continue to:

Last updated