GitHub

Tabs

Tabs provide a way to navigate between panels that display related content.

Components

DaffTabsComponent

import { DaffTabsComponent } from '@daffodil/design/tabs'

Tabs provide a way to navigate between panels that display related content.

@Component()
class DaffTabsComponent implements AfterContentInit, OnInit {
  @Input() initiallySelected: string = null
  @Input() linkMode: boolean = false
  @Input() url: string
  @Input() queryParam: string = 'tab'

  @Output() tabChange: EventEmitter<string> = new EventEmitter<string>()
}

Inputs

initiallySelected
string
Defaultnull
Description

The tab that is selected on initial load. If it's not used, the first tab in the tablist will be selected by default.

linkMode
boolean
Defaultfalse
Description

Replace the tab buttons as links.

url
string
Default
Description

The URL to navigate to when the component is in link mode. This component will set the specified query param.

queryParam
string
Default'tab'
Description

The query parameter that the tabs component will use to set the tab value in link mode.

Outputs

tabChange
EventEmitter<string>
Default
Description

Event emitted when tab selection changes.


DaffTabPanelComponent

import { DaffTabPanelComponent } from '@daffodil/design/tabs'

DaffTabPanelComponent is used to display the content panel of a tab.

@Component()
class DaffTabPanelComponent {}

DaffTabComponent

import { DaffTabComponent } from '@daffodil/design/tabs'

DaffTabComponet is an element in the tab list that is used as a content container to group the label of a tab panel and the tab panel together.

A <daff-tab> should include the DaffTabLabelComponent and DaffTabPanelComponent components in order to properly structure the UI.

@Component()
class DaffTabComponent {
  @Input() disabled: boolean = false
  @Input() id: string = 'daff-tab-' + tabId
}

Inputs

disabled
boolean
Defaultfalse
Description

Whether the tab is disabled.

id
string
Default'daff-tab-' + tabId
Description

A unique id for the tab component.

The id is automatically generated by linking the prefix 'daff-tab-' with an incrementing tabId. This value can be customized by passing a different id value via the component's id input.


DaffTabLabelComponent

import { DaffTabLabelComponent } from '@daffodil/design/tabs'

DaffTabLabelComponent is used to display the label of a tab panel. Labels may optionally contain a daffPrefix or daffSuffix to add icons or badges.

@Component()
class DaffTabLabelComponent implements DaffPrefixable, DaffSuffixable {}