Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/content-header-responsive-text.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@siemens/ix': minor
'@siemens/ix-angular': minor
'@siemens/ix-react': minor
'@siemens/ix-vue': minor
---

Add responsive wrapping for `ix-content-header` titles and subtitles and a `textOverflow="truncate"` option for compact single-line ellipsis behavior with native tooltips for both values.
4 changes: 4 additions & 0 deletions packages/angular-standalone-test-app/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ export const routePaths: IxPreviewRoutes = {
import('../preview-examples/content-header').then((m) => m.default),
'preview/content-header-no-back': () =>
import('../preview-examples/content-header-no-back').then((m) => m.default),
'preview/content-header-truncate': () =>
import('../preview-examples/content-header-truncate').then(
(m) => m.default
),
'preview/content-header-with-slot': () =>
import('../preview-examples/content-header-with-slot').then(
(m) => m.default
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--
SPDX-FileCopyrightText: 2026 Siemens AG

SPDX-License-Identifier: MIT

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
-->

<ix-content-header
hasBackButton
headerTitle="Content title that remains compact when horizontal space is limited"
headerSubtitle="Supporting context is available from the native tooltip"
textOverflow="truncate"
>
<ix-button variant="tertiary">Button1</ix-button>
<ix-button variant="tertiary">Button2</ix-button>
<ix-button variant="tertiary">Button3</ix-button>
</ix-content-header>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* SPDX-FileCopyrightText: 2026 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import { Component } from '@angular/core';
import { IxButton, IxContentHeader } from '@siemens/ix-angular/standalone';

@Component({
selector: 'app-example',
imports: [IxContentHeader, IxButton],
templateUrl: './content-header-truncate.html',
})
export default class ContentHeaderTruncate {}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ix-content-header
hasBackButton
headerTitle="Content title"
headerSubtitle="Subtitle"
headerTitle="Content title that remains compact when horizontal space is limited"
headerSubtitle="Supporting context is available from the native tooltip"
>
<ix-button variant="tertiary">Button1</ix-button>
<ix-button variant="tertiary">Button2</ix-button>
Expand Down
5 changes: 5 additions & 0 deletions packages/angular-test-app/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import Chip from '../preview-examples/chip';
import ContentExample from '../preview-examples/content';
import ContentHeader from '../preview-examples/content-header';
import ContentHeaderNoBack from '../preview-examples/content-header-no-back';
import ContentHeaderTruncate from '../preview-examples/content-header-truncate';
import ContentHeaderWithSlot from '../preview-examples/content-header-with-slot';
import CustomField from '../preview-examples/custom-field';
import CustomFieldValidation from '../preview-examples/custom-field-validation';
Expand Down Expand Up @@ -547,6 +548,10 @@ const routes: Routes = [
path: 'content-header',
component: ContentHeader,
},
{
path: 'content-header-truncate',
component: ContentHeaderTruncate,
},
{
path: 'content-header-with-slot',
component: ContentHeaderWithSlot,
Expand Down
2 changes: 2 additions & 0 deletions packages/angular-test-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import Chip from '../preview-examples/chip';
import ContentExample from '../preview-examples/content';
import ContentHeader from '../preview-examples/content-header';
import ContentHeaderNoBack from '../preview-examples/content-header-no-back';
import ContentHeaderTruncate from '../preview-examples/content-header-truncate';
import ContentHeaderWithSlot from '../preview-examples/content-header-with-slot';
import CustomField from '../preview-examples/custom-field';
import CustomFieldValidation from '../preview-examples/custom-field-validation';
Expand Down Expand Up @@ -348,6 +349,7 @@ import WorkflowVertical from '../preview-examples/workflow-vertical';
ContentExample,
ContentHeader,
ContentHeaderNoBack,
ContentHeaderTruncate,
ContentHeaderWithSlot,
DatepickerRange,
Datepicker,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--
SPDX-FileCopyrightText: 2026 Siemens AG

SPDX-License-Identifier: MIT

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
-->

<ix-content-header
hasBackButton
headerTitle="Content title that remains compact when horizontal space is limited"
headerSubtitle="Supporting context is available from the native tooltip"
textOverflow="truncate"
>
<ix-button variant="tertiary">Button1</ix-button>
<ix-button variant="tertiary">Button2</ix-button>
<ix-button variant="tertiary">Button3</ix-button>
</ix-content-header>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* SPDX-FileCopyrightText: 2026 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import { Component } from '@angular/core';

@Component({
standalone: false,
selector: 'app-example',
templateUrl: './content-header-truncate.html',
})
export default class ContentHeaderTruncate {}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ix-content-header
hasBackButton
headerTitle="Content title"
headerSubtitle="Subtitle"
headerTitle="Content title that remains compact when horizontal space is limited"
headerSubtitle="Supporting context is available from the native tooltip"
>
<ix-button variant="tertiary">Button1</ix-button>
<ix-button variant="tertiary">Button2</ix-button>
Expand Down
4 changes: 2 additions & 2 deletions packages/angular/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,14 +712,14 @@ export declare interface IxContent extends Components.IxContent {}


@ProxyCmp({
inputs: ['hasBackButton', 'headerSubtitle', 'headerTitle', 'variant']
inputs: ['hasBackButton', 'headerSubtitle', 'headerTitle', 'textOverflow', 'variant']
})
@Component({
selector: 'ix-content-header',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['hasBackButton', 'headerSubtitle', 'headerTitle', 'variant'],
inputs: ['hasBackButton', 'headerSubtitle', 'headerTitle', 'textOverflow', 'variant'],
outputs: ['backButtonClick'],
standalone: false
})
Expand Down
4 changes: 2 additions & 2 deletions packages/angular/standalone/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -823,14 +823,14 @@ export declare interface IxContent extends Components.IxContent {}

@ProxyCmp({
defineCustomElementFn: defineIxContentHeader,
inputs: ['hasBackButton', 'headerSubtitle', 'headerTitle', 'variant']
inputs: ['hasBackButton', 'headerSubtitle', 'headerTitle', 'textOverflow', 'variant']
})
@Component({
selector: 'ix-content-header',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['hasBackButton', 'headerSubtitle', 'headerTitle', 'variant'],
inputs: ['hasBackButton', 'headerSubtitle', 'headerTitle', 'textOverflow', 'variant'],
outputs: ['backButtonClick'],
})
export class IxContentHeader {
Expand Down
17 changes: 15 additions & 2 deletions packages/core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { InputState } from "./components/category-filter/input-state";
import { ChatAttachmentStatus } from "./components/chat-attachment/chat-attachment.types";
import { ChipVariant } from "./components/chip/chip.types";
import { ColumnSize } from "./components/col/col.types";
import { ContentHeaderVariant } from "./components/content-header/content-header.types";
import { ContentHeaderTextOverflow, ContentHeaderVariant } from "./components/content-header/content-header.types";
import { CssGridTemplateType } from "./components/css-grid/css-grid.types";
import { ButtonVariant as ButtonVariant1 } from "./components/button/button";
import { DateDropdownOption, DateRangeChangeEvent } from "./components/date-dropdown/date-dropdown.types";
Expand Down Expand Up @@ -79,7 +79,7 @@ export { InputState } from "./components/category-filter/input-state";
export { ChatAttachmentStatus } from "./components/chat-attachment/chat-attachment.types";
export { ChipVariant } from "./components/chip/chip.types";
export { ColumnSize } from "./components/col/col.types";
export { ContentHeaderVariant } from "./components/content-header/content-header.types";
export { ContentHeaderTextOverflow, ContentHeaderVariant } from "./components/content-header/content-header.types";
export { CssGridTemplateType } from "./components/css-grid/css-grid.types";
export { ButtonVariant as ButtonVariant1 } from "./components/button/button";
export { DateDropdownOption, DateRangeChangeEvent } from "./components/date-dropdown/date-dropdown.types";
Expand Down Expand Up @@ -1051,6 +1051,12 @@ export namespace Components {
* Title of Header
*/
"headerTitle"?: string;
/**
* Controls how the title and subtitle handle limited horizontal space.
* @since 5.2.0
* @default 'wrap'
*/
"textOverflow": ContentHeaderTextOverflow;
/**
* Variant of content header
* @default 'primary'
Expand Down Expand Up @@ -8020,6 +8026,12 @@ declare namespace LocalJSX {
* Triggered when back button is clicked
*/
"onBackButtonClick"?: (event: IxContentHeaderCustomEvent<void>) => void;
/**
* Controls how the title and subtitle handle limited horizontal space.
* @since 5.2.0
* @default 'wrap'
*/
"textOverflow"?: ContentHeaderTextOverflow;
/**
* Variant of content header
* @default 'primary'
Expand Down Expand Up @@ -12383,6 +12395,7 @@ declare namespace LocalJSX {
"variant": ContentHeaderVariant;
"headerTitle": string;
"headerSubtitle": string | undefined;
"textOverflow": ContentHeaderTextOverflow;
"hasBackButton": boolean;
}
interface IxCssGridItemAttributes {
Expand Down
19 changes: 15 additions & 4 deletions packages/core/src/components/content-header/content-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,30 @@
flex-direction: column;
flex: 1 1 0;
min-width: 0;
white-space: nowrap;
margin-right: 0.5rem;

.titleOverflow {
overflow: hidden;
text-overflow: ellipsis;
.headerText {
min-width: 0;
overflow-wrap: anywhere;

&.truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}

.headerTitleRow {
display: flex;

.headerText {
flex: 0 1 auto;
}

.headerSlot {
display: inline-flex;
flex: 0 0 auto;
align-self: flex-start;
margin-left: 0.5rem;
}
}
Expand Down
27 changes: 23 additions & 4 deletions packages/core/src/components/content-header/content-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@

import { iconArrowLeft } from '@siemens/ix-icons/icons';
import { Component, Event, EventEmitter, h, Host, Prop } from '@stencil/core';
import type { ContentHeaderVariant } from './content-header.types';
import type {
ContentHeaderTextOverflow,
ContentHeaderVariant,
} from './content-header.types';

/**
* @slot header - Content to be placed in the header area next to the title
Expand All @@ -36,6 +39,13 @@ export class ContentHeader {
*/
@Prop() headerSubtitle: string | undefined = undefined;

/**
* Controls how the title and subtitle handle limited horizontal space.
*
* @since 5.2.0
*/
@Prop({ reflect: true }) textOverflow: ContentHeaderTextOverflow = 'wrap';

/**
* Display a back button
*/
Expand Down Expand Up @@ -64,8 +74,12 @@ export class ContentHeader {
format={this.variant === 'secondary' ? 'h4' : 'h3'}
class={{
secondary: this.variant === 'secondary',
titleOverflow: true,
headerText: true,
truncate: this.textOverflow === 'truncate',
}}
title={
this.textOverflow === 'truncate' ? this.headerTitle : undefined
}
>
{this.headerTitle}
</ix-typography>
Expand All @@ -79,9 +93,14 @@ export class ContentHeader {
text-color={'soft'}
class={{
subtitle: this.variant === 'secondary',
titleOverflow: true,
headerText: true,
truncate: this.textOverflow === 'truncate',
}}
title={this.headerSubtitle}
title={
this.textOverflow === 'truncate'
? this.headerSubtitle
: undefined
}
>
{this.headerSubtitle}
</ix-typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
* LICENSE file in the root directory of this source tree.
*/
export type ContentHeaderVariant = 'primary' | 'secondary';

export type ContentHeaderTextOverflow = 'wrap' | 'truncate';
Loading
Loading