[youtubei.js](../../../../README.md) / [YTNodes](../README.md) / ButtonView # Class: ButtonView Defined in: [src/parser/classes/ButtonView.ts:6](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L6) ## Extends - [`YTNode`](../../Helpers/classes/YTNode.md) ## Constructors ### Constructor > **new ButtonView**(`data`): `ButtonView` Defined in: [src/parser/classes/ButtonView.ts:38](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L38) #### Parameters ##### data [`RawNode`](../../../../type-aliases/RawNode.md) #### Returns `ButtonView` #### Overrides [`YTNode`](../../Helpers/classes/YTNode.md).[`constructor`](../../Helpers/classes/YTNode.md#constructor) ## Properties ### accessibility\_id? > `optional` **accessibility\_id**: `string` Defined in: [src/parser/classes/ButtonView.ts:30](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L30) *** ### accessibility\_text? > `optional` **accessibility\_text**: `string` Defined in: [src/parser/classes/ButtonView.ts:36](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L36) *** ### button\_size? > `optional` **button\_size**: `"BUTTON_VIEW_MODEL_SIZE_UNKNOWN"` \| `"BUTTON_VIEW_MODEL_SIZE_DEFAULT"` \| `"BUTTON_VIEW_MODEL_SIZE_COMPACT"` \| `"BUTTON_VIEW_MODEL_SIZE_XSMALL"` \| `"BUTTON_VIEW_MODEL_SIZE_LARGE"` \| `"BUTTON_VIEW_MODEL_SIZE_XLARGE"` \| `"BUTTON_VIEW_MODEL_SIZE_XXLARGE"` Defined in: [src/parser/classes/ButtonView.ts:14](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L14) *** ### button\_type? > `optional` **button\_type**: `"BUTTON_VIEW_MODEL_TYPE_UNKNOWN"` \| `"BUTTON_VIEW_MODEL_TYPE_FILLED"` \| `"BUTTON_VIEW_MODEL_TYPE_OUTLINE"` \| `"BUTTON_VIEW_MODEL_TYPE_TEXT"` \| `"BUTTON_VIEW_MODEL_TYPE_TONAL"` Defined in: [src/parser/classes/ButtonView.ts:28](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L28) *** ### custom\_background\_color? > `optional` **custom\_background\_color**: `number` Defined in: [src/parser/classes/ButtonView.ts:31](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L31) *** ### custom\_border\_color? > `optional` **custom\_border\_color**: `number` Defined in: [src/parser/classes/ButtonView.ts:19](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L19) *** ### custom\_dark\_theme\_border\_color? > `optional` **custom\_dark\_theme\_border\_color**: `number` Defined in: [src/parser/classes/ButtonView.ts:23](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L23) *** ### custom\_font\_color? > `optional` **custom\_font\_color**: `number` Defined in: [src/parser/classes/ButtonView.ts:27](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L27) *** ### enable\_full\_width\_margins? > `optional` **enable\_full\_width\_margins**: `boolean` Defined in: [src/parser/classes/ButtonView.ts:26](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L26) *** ### enable\_icon\_button? > `optional` **enable\_icon\_button**: `boolean` Defined in: [src/parser/classes/ButtonView.ts:11](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L11) *** ### enabled? > `optional` **enabled**: `boolean` Defined in: [src/parser/classes/ButtonView.ts:29](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L29) *** ### icon\_image? > `optional` **icon\_image**: `object` Defined in: [src/parser/classes/ButtonView.ts:22](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L22) *** ### icon\_image\_flip\_for\_rtl? > `optional` **icon\_image\_flip\_for\_rtl**: `boolean` Defined in: [src/parser/classes/ButtonView.ts:13](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L13) *** ### icon\_name? > `optional` **icon\_name**: `string` Defined in: [src/parser/classes/ButtonView.ts:10](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L10) *** ### icon\_position? > `optional` **icon\_position**: `"BUTTON_VIEW_MODEL_ICON_POSITION_UNKNOWN"` \| `"BUTTON_VIEW_MODEL_ICON_POSITION_TRAILING"` \| `"BUTTON_VIEW_MODEL_ICON_POSITION_LEADING"` \| `"BUTTON_VIEW_MODEL_ICON_POSITION_ABOVE"` \| `"BUTTON_VIEW_MODEL_ICON_POSITION_LEADING_TRAILING"` Defined in: [src/parser/classes/ButtonView.ts:15](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L15) *** ### icon\_trailing? > `optional` **icon\_trailing**: `boolean` Defined in: [src/parser/classes/ButtonView.ts:35](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L35) *** ### is\_full\_width? > `optional` **is\_full\_width**: `boolean` Defined in: [src/parser/classes/ButtonView.ts:16](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L16) *** ### on\_disabled\_tap? > `optional` **on\_disabled\_tap**: [`NavigationEndpoint`](NavigationEndpoint.md) Defined in: [src/parser/classes/ButtonView.ts:18](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L18) *** ### on\_long\_press? > `optional` **on\_long\_press**: [`NavigationEndpoint`](NavigationEndpoint.md) Defined in: [src/parser/classes/ButtonView.ts:32](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L32) *** ### on\_tap? > `optional` **on\_tap**: [`NavigationEndpoint`](NavigationEndpoint.md) Defined in: [src/parser/classes/ButtonView.ts:20](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L20) *** ### on\_visible? > `optional` **on\_visible**: `object` Defined in: [src/parser/classes/ButtonView.ts:34](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L34) *** ### secondary\_icon\_image? > `optional` **secondary\_icon\_image**: [`Thumbnail`](../../Misc/classes/Thumbnail.md)[] Defined in: [src/parser/classes/ButtonView.ts:9](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L9) *** ### state? > `optional` **state**: `"BUTTON_VIEW_MODEL_STATE_UNKNOWN"` \| `"BUTTON_VIEW_MODEL_STATE_ACTIVE"` \| `"BUTTON_VIEW_MODEL_STATE_INACTIVE"` \| `"BUTTON_VIEW_MODEL_STATE_DISABLED"` Defined in: [src/parser/classes/ButtonView.ts:17](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L17) *** ### style? > `optional` **style**: `"BUTTON_VIEW_MODEL_STYLE_UNKNOWN"` \| `"BUTTON_VIEW_MODEL_STYLE_CTA"` \| `"BUTTON_VIEW_MODEL_STYLE_BRAND"` \| `"BUTTON_VIEW_MODEL_STYLE_ADS_CTA"` \| `"BUTTON_VIEW_MODEL_STYLE_OVERLAY"` \| `"BUTTON_VIEW_MODEL_STYLE_CTA_THEMED"` \| `"BUTTON_VIEW_MODEL_STYLE_BLACK_CTA"` \| `"BUTTON_VIEW_MODEL_STYLE_CUSTOM"` \| `"BUTTON_VIEW_MODEL_STYLE_MONO"` \| `"BUTTON_VIEW_MODEL_STYLE_OVERLAY_DARK"` \| `"BUTTON_VIEW_MODEL_STYLE_CTA_OVERLAY"` \| `"BUTTON_VIEW_MODEL_STYLE_BRAND_AI"` \| `"BUTTON_VIEW_MODEL_STYLE_YT_GRADIENT"` \| `"BUTTON_VIEW_MODEL_STYLE_BRAND_GRADIENT"` Defined in: [src/parser/classes/ButtonView.ts:21](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L21) *** ### target\_id? > `optional` **target\_id**: `string` Defined in: [src/parser/classes/ButtonView.ts:25](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L25) *** ### title? > `optional` **title**: `string` Defined in: [src/parser/classes/ButtonView.ts:24](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L24) *** ### title\_formatted? > `optional` **title\_formatted**: `object` Defined in: [src/parser/classes/ButtonView.ts:33](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L33) *** ### tooltip? > `optional` **tooltip**: `string` Defined in: [src/parser/classes/ButtonView.ts:12](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L12) *** ### type > `readonly` **type**: `string` Defined in: [src/parser/helpers.ts:8](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/helpers.ts#L8) #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`type`](../../Helpers/classes/YTNode.md#type) *** ### type > `static` **type**: `string` = `'ButtonView'` Defined in: [src/parser/classes/ButtonView.ts:7](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/classes/ButtonView.ts#L7) #### Overrides [`YTNode`](../../Helpers/classes/YTNode.md).[`type`](../../Helpers/classes/YTNode.md#type-1) ## Methods ### as() > **as**\<`T`, `K`\>(...`types`): `InstanceType`\<`K`\[`number`\]\> Defined in: [src/parser/helpers.ts:29](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/helpers.ts#L29) Cast to one of the given types. #### Type Parameters ##### T `T` *extends* [`YTNode`](../../Helpers/classes/YTNode.md) ##### K `K` *extends* [`YTNodeConstructor`](../../Helpers/interfaces/YTNodeConstructor.md)\<`T`\>[] #### Parameters ##### types ...`K` The types to cast to #### Returns `InstanceType`\<`K`\[`number`\]\> The node cast to one of the given types #### Throws If the node is not of the given type #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`as`](../../Helpers/classes/YTNode.md#as) *** ### hasKey() > **hasKey**\<`T`, `R`\>(`key`): `this is ButtonView & { [k in string]: R }` Defined in: [src/parser/helpers.ts:41](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/helpers.ts#L41) Check for a key without asserting the type. #### Type Parameters ##### T `T` *extends* `string` ##### R `R` = `any` #### Parameters ##### key `T` The key to check #### Returns `this is ButtonView & { [k in string]: R }` Whether the node has the key #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`hasKey`](../../Helpers/classes/YTNode.md#haskey) *** ### is() > **is**\<`T`, `K`\>(...`types`): `this is InstanceType` Defined in: [src/parser/helpers.ts:19](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/helpers.ts#L19) Check if the node is of the given type. #### Type Parameters ##### T `T` *extends* [`YTNode`](../../Helpers/classes/YTNode.md) ##### K `K` *extends* [`YTNodeConstructor`](../../Helpers/interfaces/YTNodeConstructor.md)\<`T`\>[] #### Parameters ##### types ...`K` The type to check #### Returns `this is InstanceType` whether the node is of the given type #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`is`](../../Helpers/classes/YTNode.md#is) *** ### key() > **key**\<`T`, `R`\>(`key`): [`Maybe`](../../Helpers/classes/Maybe.md) Defined in: [src/parser/helpers.ts:51](https://github.com/LuanRT/YouTube.js/blob/853a36307b5d644ada14dcb1216c2c22c2ae7b73/src/parser/helpers.ts#L51) Assert that the node has the given key and return it. #### Type Parameters ##### T `T` *extends* `string` ##### R `R` = `any` #### Parameters ##### key `T` The key to check #### Returns [`Maybe`](../../Helpers/classes/Maybe.md) The value of the key wrapped in a Maybe #### Throws If the node does not have the key #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`key`](../../Helpers/classes/YTNode.md#key)