---
id: fast-element.customelement
title: customElement() function
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-element](./fast-element.md) &gt; [customElement](./fast-element.customelement.md)

## customElement() function

Decorator: Defines a platform custom element based on `FASTElement`<!-- -->.

<b>Signature:</b>

```typescript
export declare function customElement(nameOrDef: string | PartialFASTElementDefinition): (type: Function) => void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  nameOrDef | string \| [PartialFASTElementDefinition](./fast-element.partialfastelementdefinition.md) | The name of the element to define or a definition object that describes the element to define. |

<b>Returns:</b>

(type: Function) =&gt; void
