-
Notifications
You must be signed in to change notification settings - Fork 0
Events
Brandon Jordan edited this page Sep 10, 2023
·
11 revisions
Events are on all elements and allow you to trigger something when an event occurs for the element.
The returned e
is the element, meaning you can chain methods to this element that will be triggered when the event fires.
Element()
.onClick( (e) => e
.rotate()
)
onLoad( (e) => e )
onClick( (e) => e )
onChange( (e) => e )
-
onHover( (e) => e, (e) => e )
- Callbacks for the mouse entering and leaving onFocus( (e) => e )
onBlur( (e) => e )
onDoubleClick( (e) => e )
onError( (e) => e )
-
onKeypress( (e) => e )
- Meant for use with theTextInput()
,TextBox()
, etc.
These events are triggered by screen size changes using standard screen size ratios.
onDeviceSmall( (e) => e )
onDeviceMedium( (e) => e )
onDeviceLarge( (e) => e )
You can apply effects like :hover
, :active
, and :focus
using the helper methods. This can be chained along with methods that define the initial style.
globalStyle('input, textarea')
.border('gray','2px')
.hover((e) => e
.borderColor('darkgray)
)
.rounded('5px');