I am using Blazorise, which provide multiple base components such as <Button>, with multiple parameters.
I would like to create a simple component which would render a <Button> with one or two parameters hard-coded (such as Color="Colors.Primary") and then pass the rest of the parameters onto the <Button>.
This is what I would like to be able to write:
<PrimaryButton Outline>Text</Button>
I would like to achieve this without having to manually set all parameters available from <Button> in PrimaryButton.razor. I have been looking for a way to do this for some time but can't find anything. Is It even possible?
I already tried inheriting from Button and writing <Button @attributes="@Attributes" Color="Colors.Primary"> but the implicit parameters are discarded.
I think you still have to pass them as parameters by adding them to your custom component. For instance you could do a button with
ColorandOutlineset but pass on theBlockparameter.You could then use that new component as