Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| schema | String | Yes | The feature schema to check (see syntax below) |
Schema Syntax
Themy.canIUse function accepts a dot-notation string to specify what feature to check:
- API Checks
- Component Checks
Syntax:
${API}.${type}.${param}.${option}| Part | Description |
|---|---|
API | Name of the API to check |
type | Check type: object (parameter), return (return value), or callback |
param | Parameter or return property name |
option | Specific option or value to check |
Return Value
| Type | Description |
|---|---|
| Boolean | true if the feature is supported, false otherwise |
Code Examples
Check API Availability
Check API Parameter Support
Check Return Value Support
Check Component Attribute Support
Common Use Cases
Graceful Degradation
Graceful Degradation
Use
my.canIUse to provide fallback behavior when features aren’t available:Feature Detection for UI
Feature Detection for UI
Conditionally render UI elements based on platform capabilities: