diff --git a/packages/db-ui-elements-stencil/src/components/db-dropdown/db-dropdown.tsx b/packages/db-ui-elements-stencil/src/components/db-dropdown/db-dropdown.tsx index 9057ae1582..9944ca4ba1 100644 --- a/packages/db-ui-elements-stencil/src/components/db-dropdown/db-dropdown.tsx +++ b/packages/db-ui-elements-stencil/src/components/db-dropdown/db-dropdown.tsx @@ -22,6 +22,11 @@ export class DbDropdown { */ @Prop({ reflect: true }) summary = ''; + /** + * Define an icon by it's identifier (like e.g. _download_, compare to [DB UI Icons](https://db-ui.github.io/core/patterns/base-icons/index.html)) to get displayed in front of the elements content. + */ + @Prop({ reflect: true }) icon?: string; + private compData: DbLinkType[]; private hasItemsWrapper: boolean; @@ -56,7 +61,9 @@ export class DbDropdown { class="cmp-dropdown" data-horizontal-position={this.opposite && 'opposite'} > - {this.summary} + + {this.icon ? : this.summary} + {this.compData && ( )} diff --git a/packages/db-ui-elements-stencil/src/components/db-dropdown/stories/db-dropdown.stories.mdx b/packages/db-ui-elements-stencil/src/components/db-dropdown/stories/db-dropdown.stories.mdx index 621e23aad9..2127b3da25 100644 --- a/packages/db-ui-elements-stencil/src/components/db-dropdown/stories/db-dropdown.stories.mdx +++ b/packages/db-ui-elements-stencil/src/components/db-dropdown/stories/db-dropdown.stories.mdx @@ -87,4 +87,23 @@ export type DbLinkType = { +dropdown with individual icon + +If you'd like to define an [individual icon](https://db-ui.github.io/core/patterns/base-icons/index.html) for the button that toggles the `dropdown`, you could define it via the `icon`-attribute. + + + +
  • + + Modify + +
  • +
  • + + Delete + +
  • +
    +
    + diff --git a/packages/db-ui-elements-stencil/src/components/db-overflow-menu/db-overflow-menu.tsx b/packages/db-ui-elements-stencil/src/components/db-overflow-menu/db-overflow-menu.tsx index 9eb72917d2..9977f4bd55 100644 --- a/packages/db-ui-elements-stencil/src/components/db-overflow-menu/db-overflow-menu.tsx +++ b/packages/db-ui-elements-stencil/src/components/db-overflow-menu/db-overflow-menu.tsx @@ -22,6 +22,11 @@ export class DbOverflowMenu { */ @Prop({ reflect: true }) summary = ''; + /** + * Define an icon by it's identifier (like e.g. _download_, compare to [DB UI Icons](https://db-ui.github.io/core/patterns/base-icons/index.html)) to get displayed in front of the elements content. + */ + @Prop({ reflect: true }) icon?: string; + private compData: DbLinkType[]; private hasItemsWrapper: boolean; @@ -56,7 +61,9 @@ export class DbOverflowMenu { class="cmp-overflow-menu" data-horizontal-position={this.opposite && 'opposite'} > - {this.summary} + + {this.icon ? : this.summary} + {this.compData && ( )} diff --git a/packages/db-ui-elements-stencil/src/components/db-overflow-menu/stories/db-overflow-menu.stories.mdx b/packages/db-ui-elements-stencil/src/components/db-overflow-menu/stories/db-overflow-menu.stories.mdx index 5b184fff07..f825750676 100644 --- a/packages/db-ui-elements-stencil/src/components/db-overflow-menu/stories/db-overflow-menu.stories.mdx +++ b/packages/db-ui-elements-stencil/src/components/db-overflow-menu/stories/db-overflow-menu.stories.mdx @@ -67,6 +67,21 @@ Only `