# components/lazy-part (zidane-ui)

Import: `import { … } from 'zidane-ui'`. Source: [ui/src/components/lazy-part.tsx](https://github.com/Tahul/zidane/blob/main/ui/src/components/lazy-part.tsx).

## Functions

### `lazyPart`

Function.

Wraps a dynamic import as a component.

```ts
function lazyPart<P extends object>(load: () => Promise<ComponentType<P>>): LazyPart<P>
```

**Type parameters**

- `P` (`extends object`)

**Parameters**

- `load` (`() => Promise<ComponentType<P>>`): Imports the module and picks the component.

**Returns** `LazyPart<P>`

Source: [ui/src/components/lazy-part.tsx:23](https://github.com/Tahul/zidane/blob/main/ui/src/components/lazy-part.tsx#L23)

## Types

### `LazyPart`

Type.

A lazily loaded component with a `preload` that starts its chunk.

```ts
type LazyPart<P> = ComponentType<P> & { loaded: () => boolean; preload: () => Promise<unknown> }
```

**Type parameters**

- `P`

Source: [ui/src/components/lazy-part.tsx:11](https://github.com/Tahul/zidane/blob/main/ui/src/components/lazy-part.tsx#L11)
