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>()
}
string
Default | null |
---|---|
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. |
boolean
Default | false |
---|---|
Description | Replace the tab buttons as links. |
string
Default | – |
---|---|
Description | The URL to navigate to when the component is in link mode. This component will set the specified query param. |
string
Default | 'tab' |
---|---|
Description | The query parameter that the tabs component will use to set the tab value in link mode. |
EventEmitter<string>
Default | – |
---|---|
Description | Event emitted when tab selection changes. |
<daff-tabs aria-label="List of tabs">
<daff-tab>
<daff-tab-label>
<fa-icon [icon]="faInfoCircle" daffPrefix></fa-icon>
Tab 1
</daff-tab-label>
<daff-tab-panel>
Tab 1 Panel
</daff-tab-panel>
</daff-tab>
<daff-tab>
<daff-tab-label>
Tab 2
<fa-icon [icon]="faInfoCircle" daffSuffix></fa-icon>
</daff-tab-label>
<daff-tab-panel>
Tab 2 Panel
</daff-tab-panel>
</daff-tab>
</daff-tabs>