-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actions should allow an image to be displayed in addition to text for the title #389
Comments
The slippery slope here is that someone will inevitably want it on the right, then the top, bottom, etc., leading to another layout language. |
Can this be solved with actions on ColumnSets? |
That's a bit unclear @danmarshall . The issue I'm trying to solve is a Container ( with a Column Set containing an Image and a TextBlock, as well as an InputBox). I want the "submit" button to submit information from the Image ( a feedback action) as well as the contents of the input box. If I use the selectAction the entire container sends the click without the user being able to enter information as seen here: { |
@dclaux at some point we added |
@matthidinger from the screenshot at the top of this issue it doesn't look like the image is the same height as the text: In any case, I think a configurable size is preferable. |
@matthidinger that doesn't work for toasts. We need the icon to be bigger, and on top of the text, as seen in that screenshot I provided earlier. |
Documentation is done and in the mahiding/site1.1 branch. |
is it possible to add alt text for icon ? |
Implementation status
Problem
There's no way to display an image in addition to text on an action. Some hosts, like toast notifications, are built around this experience where developers can provide "image buttons" for their actions.
This can NOT be part of the card body. The actions need to be consistently rendered just like actions are today - with the only difference being that an image can be provided.
Card authors should NOT have control over the placement of the image. Otherwise the end user experience would be inconsistent, since some toast notifications would have the image on the left, some on the right, etc.
Spec
Schema changes
We add an
iconUrl
property to action...Host Config
Defaults:
aboveTitle
and30
Update 8/3:
iconSize
was changed from a string "30px" to a number [30], to match the unit conventions throughout host config. Also updated spec to clarify defaults and some behavior.Renderer Requirements
iconPlacement
isaboveTitle
then theiconSize
should be used as the height of the image, while maintaining aspect ratio. Card Authors should use square images for ideal portability between Hosts.iconPlacement
isleftOfTitle
then the image SHOULD BE as close as possible to the height of the text in the action. If that isn't reasonable theniconSize
should be used.iconUrl
isnull
on ANY action within a set, theiconPlacement
SHOULD BEleftOfTitle
to ensure buttons are all the same height.iconPlacement
value. E.g., ifHostConfig.actions.iconPlacement
is "aboveTitle" then the platform style would be "ActionWithIconAboveTitle". This will allow for fine-grained UI treatment of Actions with icons in various placements.Downlevel Impact
Medium
On a 1.0 renderer the icon will be dropped.
The text was updated successfully, but these errors were encountered: