{/* prettier-ignore */}
{/*
Copyright 2023 Comcast Cable Communications Management, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

SPDX-License-Identifier: Apache-2.0
\*/}

import { Meta } from '@storybook/blocks';
import * as withTagsStories from './withTags.stories';

<Meta of={withTagsStories} />

# withTags

The `withTags` mixin can be wrapped around a parent component to have shortcuts for tags created.

## Source

https://github.com/rdkcentral/Lightning-UI-Components/blob/develop/packages/@lightningjs/ui-components/src/mixins/withTags/index.js

## Usage

`withTags` looks for a `static get tags` which returns an array of tags to add getters for.

```js
class Example extends withTags(lng.Component) {
  static _template() {
    return {
      Item: {
        Image: {}
      }
    };
  }

  static get tags() {
    return ['Item', { name: 'Image', path: 'Item.Image' }];
  }
}
```

This example will create two helpers `this._Item` and `this._Image` which will
return `this.tag('Item')` and `this.tag('Item.Image')` respectively.
