Closed TheHadiAhmadi closed 1 year ago
AutoComplete features:
(check Tom Select)
Alert features:
Avatar features:
Button features:
a
)Badge features
Breadcrumb features
ButtonGroup features:
all Form components should be inside Form
component
function SignupForm ({slot, ...restProps}) {
return Form({
slot: [
Form.Input({name: 'username', label: 'Username'}),
Form.Select({name: 'gender', label: 'Gender'}),
Form.Checkboxes({
name: 'languages',
label: 'Spoken Languages',
items: ["FA", "PS", "EN"]
}),
...slot
],
...restProps
})
}
@JawadAzizi Which form example is better? (above is easier to implement and below will be easier to use) above form or this?
is it possible to support below form?
import { Form } from '@ulibs/ui'
export function SignupForm ({slot, ...restProps}) {
return Form({
fields: {
username: Form.Input({ label: 'Username' }),
gender: Form.Select({ label: 'Gender' }),
languages: Form.Checkboxes({
label: 'Spoken Languages',
items: ["FA", "PS", "EN"]
})
},
onSubmit: (data) {
// this will run in backend...
const user = await UserModel.insert(data)
return {
redirect: '/users/edit?id=' + user.id
}
},
...restProps
})
}