Content switcher
Content switchers allow users to toggle between two or more content sections within the same space on the screen.
Design system docs
Examples
Default
Multi select
You can allow multiple selections by setting the multiSelect
attribute to true
. To set the value
attribute you have to set a comma separated list of values.
Importing
Importing React
Attributes
Property Type Default Description multiSelect
boolean
false
Whether the content switcher allows multiple selections. value
string
The value of the content switcher. A comma-separated list if multiSelect
is true
.
Slots
Name Description (default)
The content switcher items.
Events
Event Name Description dds-change
Fired when the content switcher is changed. *
CSS Parts
Part Name Description base
The main content switcher container.
CSS Custom Properties
Property Name Description --dds-content-switcher-min-width
The minimum width of the content switcher (default: var(--dds-spacing-4000, 160px)) --dds-content-switcher-padding
The padding of the content switcher (default: var(--dds-spacing-100, 4px)) --dds-content-switcher-border-width
The border width of the content switcher (default: var(--dds-border-width-base)) --dds-content-switcher-border-color
The border color of the content switcher (default: var(--dds-border-neutral-transparent)) --dds-content-switcher-border-radius
The border radius of the content switcher (default: var(--dds-radius-rounded, 1000px)) --dds-content-switcher-background
The background color of the content switcher (default: var(--dds-transparent-black-subtle, rgb(0 0 0 / 5%))) --dds-content-switcher-gap
The gap between content switcher items (default: var(--dds-spacing-100, 4px))
Components
Content switcher item
<dap-ds-content-switcher-item/>
Attributes
Property Type Default Description value
string
The value of the segmented control item. checked
boolean
false
The checked state of the segmented control item. disabled
boolean
false
The disabled state of the segmented control item. name
string
The name of the segmented control item.
Slots
Name Description iconcontent
The icon content of the segmented control item.
Events
No custom events available.
CSS Parts
Part Name Description input
The input of the segmented control item.
CSS Custom Properties
Property Name Description --dds-content-switcher-item-height
The height of the content switcher item (default: var(--dds-spacing-800, 32px)) --dds-content-switcher-item-padding
The padding of the content switcher item (default: var(--dds-spacing-200, 8px) var(--dds-spacing-400, 16px)) --dds-content-switcher-item-font-size
The font size of the content switcher item (default: var(--dds-size-sm, 14px)) --dds-content-switcher-item-font-weight
The font weight of the content switcher item (default: var(--dds-weight-bold, 700)) --dds-content-switcher-item-border-radius
The border radius of the content switcher item (default: var(--dds-radius-large, 16px)) --dds-content-switcher-item-background
The background color of the content switcher item (default: transparent) --dds-content-switcher-item-color
The text color of the content switcher item (default: var(--dds-text-neutral-base)) --dds-content-switcher-item-border-color
The border color of the content switcher item (default: transparent) --dds-content-switcher-item-checked-background
The background color of the checked content switcher item (default: var(--dds-button-primary-background-enabled)) --dds-content-switcher-item-checked-color
The text color of the checked content switcher item (default: var(--dds-text-neutral-on-inverted)) --dds-content-switcher-item-checked-border-color
The border color of the checked content switcher item (default: var(--dds-border-neutral-transparent-interactive))