Input

The b.InputText constructor creates a text input. The b.InputPassword constructor creates a password input. The b.InputEmail constructor creates an email input. The b.InputTel constructor creates a telephone number input.

ModifierAction
b.RoundedMake the input rounded
b.HoveredApply the hovered style
b.FocusedApply the focused style
b.LoadingAdd a loading spinner to the right of the input
b.StaticRemove specific styling but maintain vertical spacing
b.DisabledDisable the input (apply the disabled attribute)
e.ReadOnly()Read only input
e.Placeholder(string)Add a placeholder to the input
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.OnInput(...any)Apply children to the <input> element - only useful with the b.Disabled modifier if you want to apply the is-disabled class to the input instead of using the disabled attribute

Bulma examples

Example
Code
b.InputText(e.Placeholder("Text input"))
ResultHTML

Colors

Example
Code
b.InputText(b.Primary, e.Placeholder("Primary input"))
ResultHTML
Example
Code
b.InputText(b.Link, e.Placeholder("Link input"))
ResultHTML
Example
Code
b.InputText(b.Info, e.Placeholder("Info input"))
ResultHTML
Example
Code
b.InputText(b.Success, e.Placeholder("Success input"))
ResultHTML
Example
Code
b.InputText(b.Warning, e.Placeholder("Warning input"))
ResultHTML
Example
Code
b.InputText(b.Danger, e.Placeholder("Danger input"))
ResultHTML

Sizes

Example
Code
b.InputText(b.Small, e.Placeholder("Small input"))
ResultHTML
Example
Code
b.InputText(b.Normal, e.Placeholder("Normal input"))
ResultHTML
Example
Code
b.InputText(b.Medium, e.Placeholder("Medium input"))
ResultHTML
Example
Code
b.InputText(b.Large, e.Placeholder("Large input"))
ResultHTML

Styles

Example
Code
b.InputText(b.Rounded, e.Placeholder("Rounded input"))
ResultHTML

States

Example
Code
b.Control(
	b.InputText(e.Placeholder("Normal input")),
)
ResultHTML
Example
Code
b.Control(
	b.InputText(b.Hovered, e.Placeholder("Hovered input")),
)
ResultHTML
Example
Code
b.Control(
	b.InputText(b.Focused, e.Placeholder("Focused input")),
)
ResultHTML
Example
Code
b.Control(
	b.Loading,
	b.InputText(e.Placeholder("Loading input")),
)
ResultHTML
Example
Code
b.Field(
	b.Control(
		b.Small, b.Loading,
		b.InputText(b.Small, e.Placeholder("Small loading input")),
	),
),
b.Field(
	b.Control(
		b.Loading,
		b.InputText(e.Placeholder("Normal loading input")),
	),
),
b.Field(
	b.Control(
		b.Medium, b.Loading,
		b.InputText(b.Medium, e.Placeholder("Medium loading input")),
	),
),
b.Field(
	b.Control(
		b.Large, b.Loading,
		b.InputText(b.Large, e.Placeholder("Large loading input")),
	),
)
ResultHTML
Example
Code
b.Control(
	b.InputText(e.Placeholder("Disabled input"), b.Disabled),
)
ResultHTML
Example
Code
b.Control(
	b.InputText(e.Value("This text is readonly"), e.ReadOnly()),
)
ResultHTML
Example
Code
b.Field(
	b.Horizontal,
	b.FieldLabel(
		b.Normal,
		b.Label("From"),
	),
	b.FieldBody(
		b.Field(
			b.Control(
				b.InputEmail(
					b.Static,
					e.Value("me@example.com"),
					e.ReadOnly(),
				),
			),
		),
	),
),
b.Field(
	b.Horizontal,
	b.FieldLabel(
		b.Normal,
		b.Label("To"),
	),
	b.FieldBody(
		b.Field(
			b.Control(
				b.InputEmail(e.Placeholder("Recipient email")),
			),
		),
	),
)
ResultHTML

With Font Awesome icons

Example
Code
b.Field(
	b.Control(
		b.IconsLeft, b.IconsRight,
		b.InputEmail(e.Placeholder("Email")),
		fa.Icon(fa.Solid, "envelope", b.Small, b.Left),
		fa.Icon(fa.Solid, "check", b.Small, b.Right),
	),
),
b.Field(
	b.Control(
		b.IconsLeft,
		b.InputPassword(e.Placeholder("Password")),
		fa.Icon(fa.Solid, "lock", b.Small, b.Left),
	),
)
ResultHTML
Example
Code
b.Field(
	b.Control(
		b.IconsLeft, b.IconsRight,
		b.InputEmail(b.Small, e.Placeholder("Email")),
		fa.Icon(fa.Solid, "envelope", b.Small, b.Left),
		fa.Icon(fa.Solid, "check", b.Small, b.Right),
	),
)
ResultHTML
Example
Code
b.Field(
	b.Control(
		b.IconsLeft, b.IconsRight,
		b.InputEmail(e.Placeholder("Email")),
		fa.Icon(fa.Solid, "envelope", b.Small, b.Left),
		fa.Icon(fa.Solid, "check", b.Small, b.Right),
	),
)
ResultHTML
Example
Code
b.Field(
	b.Control(
		b.IconsLeft, b.IconsRight,
		b.InputEmail(b.Medium, e.Placeholder("Email")),
		fa.Icon(fa.Solid, "envelope", b.Left),
		fa.Icon(fa.Solid, "check", b.Right),
	),
)
ResultHTML
Example
Code
b.Field(
	b.Control(
		b.IconsLeft, b.IconsRight,
		b.InputEmail(b.Large, e.Placeholder("Email")),
		fa.Icon(fa.Solid, "envelope", b.Medium, b.Left),
		fa.Icon(fa.Solid, "check", b.Medium, b.Right),
	),
)
ResultHTML