Label and size in Vue Radio button component
27 Feb 20232 minutes to read
This section explains the different sizes and labels.
Label
RadioButton caption can be defined by using the label
property. This reduces the manual addition of label for RadioButton. You can customize the label position before or after the RadioButton through the labelPosition
property.
<template>
<ul>
<li> <ejs-radiobutton label="Left Side Label" name="position" labelPosition="Before"></ejs-radiobutton></li>
<li> <ejs-radiobutton label="Right Side Label" name="position" checked="true"></ejs-radiobutton></li>
</ul>
</template>
<script>
import Vue from 'vue';
import { RadioButtonPlugin } from '@syncfusion/ej2-vue-buttons';
import { enableRipple } from '@syncfusion/ej2-base';
enableRipple(true);
Vue.use(RadioButtonPlugin);
export default {}
</script>
<style>
@import '../node_modules/@syncfusion/ej2-base/styles/material.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
.e-radio-wrapper {
margin-top: 18px;
}
li {
list-style: none;
}
</style>
Size
The different RadioButton sizes available are default and small. To reduce the size of default RadioButton to small, set the cssClass
property to e-small
.
<template>
<ul>
<li> <ejs-radiobutton label="Small" name="size" checked="true" cssClass="e-small"></ejs-radiobutton></li>
<li> <ejs-radiobutton label="Default" name="size"></ejs-radiobutton></li>
</ul>
</template>
<script>
import Vue from 'vue';
import { RadioButtonPlugin } from '@syncfusion/ej2-vue-buttons';
import { enableRipple } from '@syncfusion/ej2-base';
enableRipple(true);
Vue.use(RadioButtonPlugin);
export default {}
</script>
<style>
@import '../node_modules/@syncfusion/ej2-base/styles/material.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
.e-radio-wrapper {
margin-top: 18px;
}
li {
list-style: none;
}
</style>