Create Your First View
1. Create a View Component
// 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
UI vs Widget Registration
3. Update bundle.json
4. Build Your View
Next Steps
Last updated