Select

The b.Select constructor creates a dropdown select.

ModifierAction
b.Size(int)For multiple selects, set size to the specified number of options
b.RoundedMake the select rounded
b.HoveredApply the hovered style
b.FocusedApply the focused style
b.MultipleMake the select a multiple select
b.DisabledDisable the select
b.LoadingAdd a loading spinner to the right of the select
b.PrimarySet color to primary
b.LinkSet color to link
b.InfoSet color to info
b.SuccessSet color to success
b.WarningSet color to warning
b.DangerSet color to danger
b.SmallSet size to small
b.NormalSet size to normal
b.MediumSet size to medium
b.LargeSet size to large
ChildAction
b.OnSelect(...any)Apply children to the <select> element
b.OnDiv(...any)Apply children to the <div class="select"> element
Anything elseApply child to the <div class="select"> element

The b.Option constructor creates an option element to be used as a child of b.Select.

ModifierAction
b.SelectedMark the option as selected (for multiple selects)

Bulma examples

Example
Code
b.Select(
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML

Multiple select

Example
Code
b.Select(
	b.Multiple,
	b.Size(8),
	b.Option("Argentina", "Argentina"),
	b.Option("Bolivia", "Bolivia"),
	b.Option("Brazil", "Brazil"),
	b.Option("Chile", "Chile"),
	b.Option("Colombia", "Colombia"),
	b.Option("Ecuador", "Ecuador"),
	b.Option("Guyana", "Guyana"),
	b.Option("Paraguay", "Paraguay"),
	b.Option("Peru", "Peru"),
	b.Option("Suriname", "Suriname"),
	b.Option("Uruguay", "Uruguay"),
	b.Option("Venezuela", "Venezuela"),
)
ResultHTML

Colors

Example
Code
b.Select(
	b.Primary,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML
Example
Code
b.Select(
	b.Link,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML
Example
Code
b.Select(
	b.Info,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML
Example
Code
b.Select(
	b.Success,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML
Example
Code
b.Select(
	b.Warning,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML
Example
Code
b.Select(
	b.Danger,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML

Styles

Example
Code
b.Select(
	b.Rounded,
	b.Option("", "Rounded dropdown"),
	b.Option("", "With options"),
)
ResultHTML

Sizes

Example
Code
b.Select(
	b.Small,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML
Example
Code
b.Select(
	b.Normal,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML
Example
Code
b.Select(
	b.Medium,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML
Example
Code
b.Select(
	b.Large,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML

States

Example
Code
b.Select(
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML
Example
Code
b.Select(
	b.Hovered,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML
Example
Code
b.Select(
	b.Focused,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML
Example
Code
b.Select(
	b.Loading,
	b.Option("", "Select dropdown"),
	b.Option("", "With options"),
)
ResultHTML

With icons

Example
Code
b.Control(
	b.IconsLeft,
	b.Select(
		b.OptionSelected("", "Country"),
		b.Option("", "Select dropdown"),
		b.Option("", "With options"),
	),
	fa.Icon(fa.Solid, "globe", b.Small, b.Left),
)
ResultHTML
Example
Code
b.Control(
	b.IconsLeft,
	b.Select(
		b.Small,
		b.OptionSelected("", "Country"),
		b.Option("", "Select dropdown"),
		b.Option("", "With options"),
	),
	fa.Icon(fa.Solid, "globe", b.Small, b.Left),
)
ResultHTML
Example
Code
b.Control(
	b.IconsLeft,
	b.Select(
		b.OptionSelected("", "Country"),
		b.Option("", "Select dropdown"),
		b.Option("", "With options"),
	),
	fa.Icon(fa.Solid, "globe", b.Left),
)
ResultHTML
Example
Code
b.Control(
	b.IconsLeft,
	b.Select(
		b.Medium,
		b.OptionSelected("", "Country"),
		b.Option("", "Select dropdown"),
		b.Option("", "With options"),
	),
	fa.Icon(fa.Solid, "globe", b.Medium, b.Left),
)
ResultHTML
Example
Code
b.Control(
	b.IconsLeft,
	b.Select(
		b.Large,
		b.OptionSelected("", "Country"),
		b.Option("", "Select dropdown"),
		b.Option("", "With options"),
	),
	fa.Icon(fa.Solid, "globe", b.Large, b.Left),
)
ResultHTML