Skip to content
Snippets Groups Projects
hy-tabs-item.tsx 421 B
Newer Older
  • Learn to ignore specific revisions
  • Tuukka Turu's avatar
    Tuukka Turu committed
    import {Component, h, Prop} from '@stencil/core';
    
    @Component({
      tag: 'hy-tabs-item',
      styleUrl: 'hy-tabs-item.scss',
      shadow: false,
    })
    export class HyTabsItem {
      @Prop() tabTitle?: string;
    
      render() {
        const id = this.tabTitle.toLowerCase().replace(/\W/g, '-');
    
        return (
          <div tabindex="0" role="tabpanel" id={`${id}-tab`} aria-labelledby={id} hidden>
            <slot></slot>
          </div>
        );
      }
    }