Replies: 4 comments 1 reply
-
@curtic00 Thank you for using BlazorBootstrap. Here is the example: <Button Color="ButtonColor.Primary" AdditionalAttributes="@additionalAttributes"> Primary </Button>
@code{
Dictionary<string, object> additionalAttributes = new()
{
{ "data-id", "9HFI94LD580" }
};
} ![]() |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks Vikram.Do you have a list of your controls that implements the AdditionalAttributes parameter as I have been unable to find any documentation on it?TIA, regards Charlie Charlie Curtis Worthing, West SussexBN133AB.MCSD, MCSA, MCRDBA, Azure administratorMobile: 0777 254 5516LinkedIn: https://uk.linkedin.com/in/charlieecharlieOn 13 Aug 2025, at 17:20, Vikram Reddy ***@***.***> wrote:
@curtic00 Thank you for using BlazorBootstrap.
Here is the example:
<Button Color="ButtonColor.Primary" ***@***.***"> Primary </Button>
@code{
Dictionary<string, object> additionalAttributes = new()
{
{ "data-id", "9HFI94LD580" }
};
}
image.png (view on web)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
👍👍Charlie Curtis Worthing, West SussexBN133AB.MCSD, MCSA, MCRDBA, Azure administratorMobile: 0777 254 5516LinkedIn: https://uk.linkedin.com/in/charlieecharlieOn 14 Aug 2025, at 13:20, Vikram Reddy ***@***.***> wrote:
@curtic00 AdditionalAttributes is a default parameter for all components. We will update our documentation.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi Vikram
I suppose that it would be a lot of work to create a new parameter in your base component and have it bubble up to all of the parent components?
Reason that I ask is that I use playwright for all of my integration testing, and the ‘data-testid’ attribute is the Playwright recommended approach for testing.
For example, I have nearly 140 instances of data-testid on one page…..
Regards
Charlie
From: Vikram Reddy ***@***.***>
Sent: 14 August 2025 13:20
To: vikramlearning/blazorbootstrap ***@***.***>
Cc: curtic00 ***@***.***>; Mention ***@***.***>
Subject: Re: [vikramlearning/blazorbootstrap] Additional Attributes (Discussion #1162)
@curtic00 <https://github.com/curtic00> AdditionalAttributes is a default parameter for all components. We will update our documentation.
—
Reply to this email directly, view it on GitHub <#1162 (reply in thread)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AUSOJFSPDKB2C3E25GNIEZL3NR5HLAVCNFSM6AAAAACDN7RA76VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIMJQGMZTGNI> .
You are receiving this because you were mentioned.Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
Does anyone have any good examples of using Additional Attributes parameter in components?
reason that I am asking is that I use Playwright extensively for testing, and the stated best practice is to give each component an attribute 'data-testid' , eg. data-testid="MenuButtonWelcome".
Is it acceptable to just add such a tag into a component , eg: <Button data-testid="MenuButtonWelcome" Color="ButtonColor.Secondary" .....
Or must one use the AdditionalAttributes parameter?
If so, must one declare a Dictionary variable in the code section, or can one just create the Dictionary ' in place' ?
i.e. AdditionalAttributes="@(new Dictionary<string,object>(){{"data-testid", "MenuButtonWelcome"}} )"
Any help or guidance appreciated .
TIA
Beta Was this translation helpful? Give feedback.
All reactions