Skip to content

Instantly share code, notes, and snippets.

@hasanmisbah
Created September 15, 2022 18:05
Show Gist options
  • Save hasanmisbah/2609de808d35ffa538d0296c218d135a to your computer and use it in GitHub Desktop.
Save hasanmisbah/2609de808d35ffa538d0296c218d135a to your computer and use it in GitHub Desktop.
Form Builder Schema (Draft). Build Form Based on schema
export const schema = {
name: {
type: 'text',
label: 'Name',
id: 'Name',
placeholder: '',
value: ''
},
sex: {
type: 'radio',
label: 'sex',
options: [
{
label: 'Male',
value: 'male'
},
{
label: 'Female',
value: 'female'
},
{
label: 'Other',
value: 'other'
}
],
default: 'male',
},
email: {
type: 'email',
label: 'Email',
id: 'email',
placeholder: 'Email',
value: ''
},
city: {
type: 'select',
label: 'City',
id: 'City',
placeholder: 'City',
options: [
{
label: 'Sylhet',
value: 'sylhet'
},
{
label: 'Dhaka',
value: 'Dhaka'
}
],
},
phone: {
type: 'tel',
label: 'Phone',
id: 'phone',
placeholder: 'phone',
},
profile_photo: {
type: 'image',
label: 'Profile Photo',
id: 'profile_photo',
placeholder: 'Profile Photo',
showPreview: true
},
intro_video: {
type: 'video',
label: 'Intro video',
id: 'intro_video',
placeholder: 'Intro video',
showPreview: true
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment