# VariantProps
Source: https://docs.maelstrom-ai.co/dev/reference/react/type-aliases/variantprops/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **VariantProps**<`V`\> = `{ [K in VariantNames<V>]: { variant: K } & V["variants"][K]["props"] }`\[[`VariantNames`](https://docs.maelstrom-ai.co/dev/reference/react/type-aliases/variantnames/)<`V`\>\]

Defined in: [packages/react/src/lib/vessel-entry-types.ts:34](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/react/src/lib/vessel-entry-types.ts#L34)

Discriminated union of variant prop shapes for vessel `V`.

For each variant `K` in `V`, contributes a member `{ variant: K } & V['variants'][K]['props']`. Components consume this to render different content per variant while preserving literal-type narrowing on the `variant` discriminant.

## Type Parameters

### V

`V` _extends_ `VesselDefinition`

## Example

```typescript
function OrdersComponent({ variantProps }: { variantProps: VariantProps<typeof ordersVessel> }) {
  if (variantProps.variant === 'list') {
    // variantProps narrowed to the 'list' variant's props
  }
}
```
