#102298
admin
Keymaster

Hi xyzzy,
Here’s a Blazor example with the ComboBox. In order to set the font size you can either put a CSS selector using the combobox’s INPUT or use a CSS variable –smart-font-size which changes the font-size of the Blazor combobox and its dropdown items.

@page "/combobox"
@using Smart.Blazor.Demos.Data
@inject WeatherForecastService ForecastService
<style>
.combo {
--smart-font-size: 24px;
}
</style>
<Example Name="ComboBox">
@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<h2>Forecasts Summary</h2>
<ComboBox Class="combo" SelectedIndexes="new int[] { 0 }">
@foreach (var forecast in forecasts)
{
<ListItem Label="@forecast.Summary.Trim()"></ListItem>
}
</ComboBox>
}
</Example>
@code {
private WeatherForecast[] forecasts;
protected override async Task OnInitializedAsync()
{
forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
}
}

Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/