ds-svelte-community
Nais Docs
Pages
  • Home
  • CSS
  • Icons
Typography
  • BodyLong
  • BodyShort
  • Detail
Components
  • Accordion
  • ActionMenu Beta
  • Alert
  • Button
  • Checkbox
  • Chips
  • ConfirmationPanel
  • CopyButton
  • ErrorSummary
  • ExpansionCard
  • GuidePanel
  • HelpText
  • InternalHeader Beta
  • List
  • Loader
  • Modal
  • Pagination
  • Popover
  • Radio
  • ReadMore
  • Search
  • Select
  • Skeleton
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag
  • TextField
  • ToggleGroup
  • Tooltip
Primitives
  • Bleed
  • Box

Version: 1.0.0
Try dark darkside
Try light darkside

Tabs

Tabs are used to switch between panels on a page. This helps users navigate between related content without changing context. The component consists of a row of tab buttons. A tab button is always selected, because a panel is always displayed.

Read more about this component in the Aksel documentation.

Note: This component does not yet follow all best practices regarding accessibility.

    Default
Inbox content

Properties

Tabs

PropertyDescriptionDefault
Control
Properties
value
required bindable

Controlled selected value.

string
-
iconPosition

Icon position in Tab.

"left" "top"
"left"
loop

Loops back to start when navigating past last item.

boolean
false
selectionFollowsFocus

Automatically activates tab on focus/navigation.

boolean
false
size

Changes padding and font-size.

"small" "medium"
"medium"
Snippets
children

TabList and TabPanel components.

 -

Properties included from: HTMLAttributes<HTMLDivElement>

TabList

PropertyDescriptionDefault
Control
Snippets
children

Tab list items.

 -

Properties included from: HTMLAttributes<HTMLDivElement>

Tab

Tab is an individual tab in a Tabs component. It should be used inside a TabList component.

PropertyDescriptionDefault
Control
Properties
value
required

Value of the tab.

string
-
as

Element to render as.

"button" "a"
"button"
href

URL to navigate to if as is set to "a".

string
-
Snippets
children

Label of the tab.

 -
icon

Icon to display in the tab.

 -

Properties included from: HTMLAttributes<HTMLElement>

TabPanel

PropertyDescriptionDefault
Control
Properties
value
required

Value of the tab.

string
-
Snippets
children

Content of the tab panel.

 -

Properties included from: HTMLAttributes<HTMLDivElement>