Skip to main content

App Layout

Register Icons

AppLayout.tsx
import { registerIconSet } from '@headless-adminapp/icons/register';
import { iconSet } from '@headless-adminapp/icons-fluent';

registerIconSet(iconSet);

@headless-adminapp/icons-fluent has all the icons to be used in the Admin App. But we can also use custom icons by creating a new icon set.

Setup App Layout

AppLayout.tsx
<LayoutProvider
routeProps={{
router,
pathname,
searchParams,
}}
>
<App appId="default">{children}</App>
</LayoutProvider>
);

Route props are required and should be passed to the LayoutProvider component.

Tip: You can use the useRouter, usePathName and useSearchParams hook from next/navigation for nextjs projects.

LayoutProvider Props

NameTypeDescriptionRequired
themeThemeThe theme object.No
routePropsRoutePropsThe route props.Yes
queryClientQueryClientReact-Query instanceNo
localePropsLocalProviderPropsLocale informationNo
dataServiceIDataServiceData service instanceRequired for crud operation
fileServiceIFileServiceFile service instanceRequired for file upload
authPropsAuthPropsAuth informationRequired for authentication
authPlaceholderReactNodeAuth placeholderNo
metadataPropsMetadataProviderPropsMetadata informationNo