aspekto
UI Kit written in Typescript. Declaration files are included.
Only 13kB
Install
npm install --save aspekto
Components
Button
import Button from 'aspekto' <Button =>My Button</Button>
()=> any
handle: Callback function that gets fired when the button is clicked
Switch
import Switch from 'aspekto' <Switch = />
(value: boolean)=> any
handle Callback function that gets fired when the switch is altered
boolean
checked Initial value of the switch
Input
import Input from 'aspekto'<Input = = />
string
label [required] The label of the field
(s: string) => any
handle Callback function that gets fired when the input value changes
(s: string) => boolean | Promise<boolean>
valid Function that gets called to check if the input is valid. This can be an async call to an API or simple function that checks a regex
Example
const isUsernameAvailable = await MyCoolApi <Input = =/>
boolean
disabled Whether the component is disabled or not
string
initial Initial value of the input field