> ## 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.

# Material

> A translucent blur effect similar to frosted glass, used for backgrounds that blend with content behind them.

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}
Material(props?: MaterialProps): Material;
```

<ParamField path="props" type="MaterialProps" optional>
  Material configuration. Can be a material type string or a configuration object.

  <Expandable title="Material type strings">
    <ParamField path="ultraThin" type="string">
      Most transparent material. Barely visible blur.
    </ParamField>

    <ParamField path="thin" type="string">
      Subtle blur effect.
    </ParamField>

    <ParamField path="regular" type="string">
      Balanced blur effect. This is the default.
    </ParamField>

    <ParamField path="thick" type="string">
      More prominent blur effect.
    </ParamField>

    <ParamField path="bar" type="string">
      Material for toolbar and navigation bar backgrounds.
    </ParamField>

    <ParamField path="chrome" type="string">
      Material for menus and popups.
    </ParamField>
  </Expandable>

  <Expandable title="Configuration object">
    <ParamField path="type" type="MaterialType" required>
      The material type string.
    </ParamField>

    <ParamField path="opacity" type="number" optional>
      Custom opacity for the material effect.
    </ParamField>

    <ParamField path="blurRadius" type="number" optional>
      Custom blur radius for the material effect.
    </ParamField>
  </Expandable>
</ParamField>

## Support

<PlatformStatuses
  statuses={{
ios: { status: "supported" },
android: "not-implemented",
web: { status: "supported" },
}}
/>

## Usage

### As a standalone view

`Material` can be used directly as a view that fills its frame with a blur effect:

```typescript theme={null}
Material("thin")
    .frame({ width: 200, height: 200 })
```

### As a background

```typescript theme={null}
Text("Over blurred background")
    .padding(16)
    .background(Material("thin"))
    .cornerRadius(12)
```

### Material types comparison

```typescript theme={null}
VStack({ spacing: 16 }, [
    Text("Ultra Thin").padding(12).background(Material("ultraThin")),
    Text("Thin").padding(12).background(Material("thin")),
    Text("Regular").padding(12).background(Material("regular")),
    Text("Thick").padding(12).background(Material("thick"))
])
```

### Custom configuration

```typescript theme={null}
Material({
    type: "regular",
    opacity: 0.8,
    blurRadius: 20
})
```

### As a foreground style

```typescript theme={null}
Text("Frosted Text")
    .font("largeTitle")
    .foregroundStyle(Material("thin"))
```
