# Component

Class · extends [`EventHandler`](https://api.playcanvas.com/engine/classes/EventHandler.md) · category: Other

Source: https://github.com/playcanvas/engine/blob/dfcc50fbbfba2388843041a875ec0ef5d1a586c5/src/framework/components/component.js#L14

Components are used to attach functionality on a [Entity](https://api.playcanvas.com/engine/classes/Entity.md). Components can receive update
events each frame, and expose properties to the PlayCanvas Editor.

## Properties

### entity

```ts
entity: Entity
```

The Entity that this Component is attached to.

### system

```ts
system: ComponentSystem
```

The ComponentSystem used to create this Component.

## Accessors

### enabled

```ts
get enabled(): boolean
set enabled(value: boolean)
```

Gets the enabled state of the component.

## Inherited from [EventHandler](https://api.playcanvas.com/engine/classes/EventHandler.md)

- `fire(name: string, arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any, arg6?: any, arg7?: any, arg8?: any): EventHandler`
- `hasEvent(name: string): boolean`
- `off(name?: string, callback?: HandleEventCallback, scope?: any): EventHandler`
- `on(name: string, callback: HandleEventCallback, scope?: any): EventHandle`
- `once(name: string, callback: HandleEventCallback, scope?: any): EventHandle`
