Skip to content

EnInputRadioGroup ​

Preview ​

Props ​

NameDescriptionDefaultControl
value

Used for a raw value passed into the input.

string
""
options

Array of option objects with label and value keys.

unknown[]
unknowncomplex object
label

Sets the label for the group of radios.

string
""
tooltip

Text for an info tooltip rendered after the group's own label.

string
""
tooltipProps

Extra props for the EnTooltip or EnPopover behind tooltip, passed straight through.

Record<string, any>
{}
popover

Shows tooltip as a click-to-open EnPopover instead of a hover EnTooltip.

boolean
false
inline

Sets 'radio-inline' style, makes radios align horizontally.

boolean
false
horizontal

Sets the group to display horizontally.

boolean
false
labelClass

Sets the class used for the label column when using horizontal layout.

string
"col-md-3"
inputClass

Sets the class used for the input column when using horizontal layout.

string
"col-md-9"
showRequired

Displays asterisk (*) next to the group label.

boolean
false
pills

Styles the displayOnly value as pills. (displayOnly must be set to true)

boolean
false
styled

Sets an alternate style for the checkboxes.

boolean
false
btnStyle

Renders each radio with a button-like background, border, and hover/focus styling. Implicitly enables styled for the radio icon.

boolean
false
bordered

Shows a border around each option when using btnStyle.

boolean
true
justifyButtons

Lays the options out as one row of equal-width buttons that together fill the available space, instead of stacking them. Intended for btnStyle, where a short fixed set of choices ("Composite / ACA / Banded / Individual Banded") reads as one row; a stack is still right for a long list.

boolean
false
name

Sets name attribute for the input. Required for proper form handling.

string
null
id

Sets id attribute for input. If left blank, it will default to the name prop. This should always be matched to a label's "for" attribute for proper accessibility.

string
null
placeholder

Sets the placeholder value.

string
null
disabled

Sets the disabled attribute.

boolean
null
required

Sets the field to required.

boolean
false
critical

Flags the field as critical. Critical is not required: a required field blocks saving, while a critical field saves fine empty but blocks something later, such as activating or completing a record. Use it for "you will need this before you can finish", not "you must enter this now".

While the field is empty, the control takes the critical-field highlight, the element that carries has-error also carries is-critical, and a surrounding EnFormGroup adds a warning icon beside its label. Both clear once the field holds a value and return if it is cleared again: the yellow means "this important field is empty right now". A real error still wins.

boolean
false
locked

Locks the field: disables the control and marks it with a lock icon. Text-like controls show the lock inside the input, in the spot a select keeps its arrow. Option groups, booleans and file inputs have no box to put it in, so they show it beside the label of a surrounding EnFormGroup.

boolean
false
lockedMessage

Why the field is locked, for example "Locked while payroll is open". Shown as a tooltip when the pointer rests on the locked control, and on the lock icon beside the label, which becomes focusable so keyboard users can reach the text (the disabled control itself cannot take focus). Rendered through en-components' v-tooltip directive, which the consuming app registers.

string
""
typeCast

Used to specifically validate different types.

string
"string"
mode

Sets when and how often validation occurs. TODO: create docs for modes

string
"eager"
displayOnly

Displays the value of the field in a span element, instead of as an input.

boolean
false
emptyValue

What a displayOnly field shows in place of an empty value. Off by default, so an empty field renders nothing. true shows an em dash; a string shows that text instead. The placeholder is drawn in gray-700 so it reads as "nothing here" rather than as a value. EnForm and EnFormGroup take the same prop and hand it to every field they display.

string | boolean
false
rules

A pipe separated string of validation rules for the field. View validation rules

string
""
renderInForm

Prevents a field from being rendered at all when used in the fields prop of the EnForm component. Can be passed a function that returns true or false for conditional validation.

boolean | Function
true
renderInTable

Prevents a field from generating a column/heading in the EnTableBasic component. Can be passed a function that returns true or false for conditional validation.

boolean | Function
true
customMessages

Provide a custom error messages by rule. Should be an object with keys that match the rule name and value being a string of the message to display.

Record<string, any>
null
valueKey

Sets a different key to use to retrieve the value from the options passed to the component.

string
"value"
labelKey

Sets a different key to use to retrieve the label from the options passed to the component.

string
"label"
labelColors

Sets default colors for option labels in displayOnly mode

unknown[]
unknown
emptyOption

An entry for "nothing selected", prepended to the list.

The prompt is presentation, not data: it exists so the control has an unselected state, which is the component's business rather than the server's. Supplying it here keeps it out of options, which matters for a grouped list - an entry is treated as an optgroup when it carries nested options, so a prompt smuggled in as a group of one renders an unlabelled optgroup with the prompt indented inside it.

Pass { value, label }, or a string as shorthand for { value: '', label: <string> }. Omitted, no entry is added, which is how every existing consumer behaves.

{Object|String}
null
optionsKey

Sets a different key to use to retrieve the options from the option groups passed to the component.

string
"options"

Slots ​

display

No description

Variables
NameTypeDescription
selectionsunknown—

Events ​

No events defined.

Methods ​

NameDescription
focus

Focuses a radio input element in the group.

Types ​

Option - Object

Properties available when using an input that accepts options.

NameTypeDescription
labelstring

Display text for the option. Note: first letter is case insensitive meaning it will also try Label

valuestringnumber

Value of the option that will be emitted when selected. Note: first letter is case insensitive meaning it will also try Value

disabledboolean

Sets the option to disabled so that it cannot be selected or deselected.

labelColorstring

Overrides the default label color when using pills and display only, if supported.

tooltipstring

Adds a tooltip next to the option if supported by the input (radio, checkbox, boolean).

optionsarray

Array of Options when needing to use option groups.

Examples ​

A row of equal-width options ​

justifyButtons lays the options out as one row of equal-width options filling the available space, instead of stacking them — each option takes an equal share regardless of label length.

It's meant for btnStyle, where a short fixed set of choices reads as one row. A stack is still right for a long list, and for anything whose option count isn't known up front.

  • EnInputRadio — The individual radio this group renders. Only use it directly for custom layouts the group can't express.
  • EnInputButtonGroup — Radio group styled as buttons.