> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# RadialGradient

> A circular gradient that radiates colors outward from a center point.

export const PlatformStatuses = ({statuses}) => {
  const StatusBadge = ({status, label}) => {
    const styles = {
      green: {
        backgroundColor: '#dcfce7',
        color: '#166534'
      },
      orange: {
        backgroundColor: '#fed7aa',
        color: '#9a3412'
      },
      red: {
        backgroundColor: '#fecaca',
        color: '#991b1b'
      },
      gray: {
        backgroundColor: '#f3f4f6',
        color: '#4b5563'
      }
    };
    const baseStyle = {
      display: 'inline-flex',
      alignItems: 'center',
      padding: '0.125rem 0.625rem',
      borderRadius: '9999px',
      fontSize: '0.875rem',
      fontWeight: '500'
    };
    const colorStyle = styles[status] || styles.green;
    return <span style={{
      ...baseStyle,
      ...colorStyle
    }}>
        {label || status}
      </span>;
  };
  const STATUS_CONFIG = {
    supported: {
      label: "Supported",
      color: "green"
    },
    partial: {
      label: "Partial",
      color: "orange"
    },
    "not-implemented": {
      label: "Not Implemented",
      color: "gray"
    }
  };
  const renderCard = (platform, value) => {
    if (!value) return null;
    const {status, note} = typeof value === "string" ? {
      status: value
    } : value;
    const config = STATUS_CONFIG[status];
    if (!config) return null;
    const titleMap = {
      ios: "SwiftUI",
      android: "Jetpack Compose",
      web: "Web"
    };
    return <Card key={platform} title={titleMap[platform] || platform}>
          <StatusBadge status={config.color} label={config.label} />
          {note && <div style={{
      marginTop: '0.5rem',
      fontSize: '0.875rem',
      color: '#6b7280'
    }}>
              {note}
            </div>}
      </Card>;
  };
  if (statuses == null) {
    return null;
  }
  return <Columns cols="3">
      {Object.entries(statuses).map(([platform, value]) => renderCard(platform, value))}
    </Columns>;
};

export const ComposeJS = ({code, name, height}) => {
  const encodedCode = useMemo(() => {
    if (!code) return "";
    try {
      return btoa(code);
    } catch (e) {
      console.error("Failed to encode code", e);
      return "";
    }
  }, [code]);
  if (!encodedCode) {
    return null;
  }
  return <iframe src={`https://www.metabind.ai/embed?code=${encodedCode}&name=${name ?? 'Example'}`} loading="lazy" style={{
    width: "100%",
    height: height || '350px',
    border: "1px solid #e5e7eb",
    borderRadius: "var(--rounded-2xl,1rem)",
    overflow: "hidden"
  }} title="ComposeJS Preview" />;
};

```typescript theme={null}
RadialGradient(props?: {
    colors: Color[];
    center?: UnitPoint;
    startRadius?: number;
    endRadius?: number;
}): Gradient;
```

<ParamField path="colors" type="Color[]" required>
  An array of colors for the gradient. Colors transition from the center outward.
</ParamField>

<ParamField path="center" type="UnitPoint" optional>
  The center point of the gradient. See [UnitPoint](/bindjs/types/UnitPoint). Defaults to `"center"`.
</ParamField>

<ParamField path="startRadius" type="number" optional>
  The starting radius in points. The first color fills from the center to this radius.
</ParamField>

<ParamField path="endRadius" type="number" optional>
  The ending radius in points. The last color fills from this radius outward.
</ParamField>

## Support

<PlatformStatuses
  statuses={{
ios: { status: "supported" },
android: { status: "partial", note: "Only colors prop works; center, startRadius, and endRadius are ignored" },
web: { status: "supported" },
}}
/>

## Usage

### As a standalone view

```typescript theme={null}
RadialGradient({
    colors: [Color("white"), Color("black")]
})
.frame({ width: 200, height: 200 })
```

### Multi-color gradient

```typescript theme={null}
RadialGradient({
    colors: [Color("yellow"), Color("orange"), Color("red")]
})
```

### Off-center gradient

```typescript theme={null}
RadialGradient({
    colors: [Color("white"), Color("blue")],
    center: "topTrailing"
})
```

### Custom radius

```typescript theme={null}
RadialGradient({
    colors: [Color("blue"), Color("clear")],
    center: "center",
    startRadius: 0,
    endRadius: 150
})
```

### As a fill

```typescript theme={null}
Circle()
    .fill(RadialGradient({
        colors: [Color("yellow"), Color("orange"), Color("red")],
        center: "center",
        startRadius: 10,
        endRadius: 80
    }))
    .frame({ width: 160, height: 160 })
```

### As a background (spotlight effect)

```typescript theme={null}
VStack([
    Text("Spotlight").foregroundStyle(Color("white")).font("title")
])
.frame({ width: 300, height: 200 })
.background(RadialGradient({
    colors: [Color("white").opacity(0.3), Color("black")],
    center: "center",
    startRadius: 0,
    endRadius: 200
}))
```

## See Also

* [LinearGradient](/bindjs/styles/LinearGradient) -- line-based gradient
* [EllipticalGradient](/bindjs/styles/EllipticalGradient) -- elliptical variant
* [UnitPoint](/bindjs/types/UnitPoint) -- coordinate system for center point
