-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(chip): enable displaying pictures instead of icons
- Loading branch information
Showing
5 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Component, h } from '@stencil/core'; | ||
|
||
/** | ||
* Picture instead of icon | ||
* Using the `Img` interface, you can specify an image to be displayed on the chip. | ||
* | ||
* :::note | ||
* The specified image will be displayed instead of the icon, if both are provided. | ||
* ::: | ||
*/ | ||
@Component({ | ||
tag: 'limel-example-chip-image', | ||
shadow: true, | ||
}) | ||
export class ChipImageExample { | ||
public render() { | ||
const icon = { | ||
name: 'filled_star', | ||
color: 'rgb(var(--color-yellow-default))', | ||
}; | ||
|
||
const image = { | ||
src: 'https://lundalogik.github.io/lime-elements/780af2a6-d3d1-4593-8642-f03210d09271.png', | ||
alt: 'A picture of Lucy Chyzhova, UX designer at Lime Technologies', | ||
}; | ||
|
||
return <limel-chip text="Lucy Chyzhova" icon={icon} image={image} />; | ||
} | ||
} |