Hanzo GUI Props
All the base props
Hanzo GUI supports a superset of the React Native props. Start with:
From there, we add style props directly onto the same object.
Finally, there are a few non-style props Hanzo GUI adds:
Event Props
All Hanzo GUI View-based components have Pressable-like functionality built in. You don't need to wrap in Pressable or TouchableOpacity - add event handlers directly:
<View
onPress={() => console.log('pressed')}
onHoverIn={() => console.log('hovered')}
pressStyle={{ opacity: 0.8 }}
hoverStyle={{ backgroundColor: '$backgroundHover' }}
/>| Prop | Type | Default | Required |
|---|---|---|---|
| onPress | (e: GestureResponderEvent) => void | - | - |
| onPressIn | (e: GestureResponderEvent) => void | - | - |
| onPressOut | (e: GestureResponderEvent) => void | - | - |
| onLongPress | (e: GestureResponderEvent) => void | - | - |
| onHoverIn | (e: MouseEvent) => void | - | - |
| onHoverOut | (e: MouseEvent) => void | - | - |
| onFocus | (e: FocusEvent) => void | - | - |
| onBlur | (e: FocusEvent) => void | - | - |
| delayPressIn | number | - | - |
| delayPressOut | number | - | - |
| delayLongPress | number | - | - |
| minPressDuration | number | - | - |
| cancelable | boolean | - | - |
| disabled | boolean | - | - |
| focusable | boolean | - | - |
| hitSlop | number | Insets | - | - |
Use these events alongside style states like pressStyle, hoverStyle, and focusStyle to create interactive components. See the Style API for styling on interaction states.
Other Props
| Prop | Type | Default | Required |
|---|---|---|---|
| render | string | JSX.Element | ((props, state) => JSX.Element) | - | - |
| transition | string | - | - |
| animateOnly | string[] | - | - |
| theme | string | - | - |
| themeInverse | boolean | - | - |
| themeShallow | boolean | - | - |
| forceStyle | 'hover' | 'press' | 'focus' | 'focusVisible' | 'focusWithin' | - | - |
| group | boolean | string | - | - |
| componentName | string | - | - |
| className | string | - | - |
| disableClassName | boolean | - | - |
| tag | string | - | - |
| space | boolean | string | GuiConfig['space'] | - | - |
| spaceDirection | 'horizontal' | 'vertical' | 'both' | both | - |
| debug | boolean | 'verbose' | 'break' | - | - |
| untilMeasured | 'hide' | 'show' | - | - |
| disableOptimization | boolean | - | - |
| tabIndex | string | number | - | - |
| role | Role | - | - |
| asChild | boolean | 'except-style' | 'except-style-web' | 'web' | - | - |
| passThrough | boolean | - | - |
Event Handlers
Hanzo GUI supports all React Native events on all platforms. On web, we also support all standard DOM event handlers:
Cross-Platform Events
onPress,onLongPress,onPressIn,onPressOut- Touch/press events that work on both native and web
Pointer Events - Modern events that unify mouse, touch, and pen input. On native, these are mapped to touch events with a normalized event shape including clientX/Y, pointerId, and pointerType:
onPointerDown,onPointerUp,onPointerMoveonPointerEnter,onPointerLeave,onPointerCancel
On native, e.target.setPointerCapture(pointerId) and releasePointerCapture(pointerId) are supported for drag scenarios where you need to receive move events outside the element bounds.
Web-Only Events
The following events are available on web and automatically ignored on native:
Mouse Events
onClick,onDoubleClick,onContextMenuonMouseEnter,onMouseLeave,onMouseMove,onMouseOver,onMouseOutonMouseDown,onMouseUponWheel
Keyboard Events
onKeyDown,onKeyUp,onKeyPress
Drag and Drop
onDrag,onDragStart,onDragEndonDragEnter,onDragLeave,onDragOveronDrop
Input Events
onChange,onInput,onBeforeInput
Scroll Events
onScroll
Clipboard Events
onCopy,onCut,onPaste
Focus Events
onFocus,onBlur
All event handlers receive the standard React synthetic event as their argument.
Last updated on