Image
Web compatible and super light image component with Hanzo GUI style props
- Web compatible.
- Supports SSR.
- Works on native and web.
- No react-native-web dependency.
- Super light.
Installation
Image is already installed in @hanzo/gui, or you can install it independently:
npm install @hanzogui/imageUsage
export default () => <Image src="https://..." width={300} height={400} />API Reference
Image
Gui props + Web img props + React Native Image props.
All web img props are
supported on web, and all native
Image props are supported on
native. On native we are still using web img APIs, but not all web img props are
supported, like decoding.
Some common props
| Prop | Type | Default | Required |
|---|---|---|---|
| src | string | - | ✓ |
| alt | string | - | - |
| objectFit | CSS.ObjectFit | - | - |
| unstyled | boolean | - | - |
| onLoad | function | - | - |
| onError | function | - | - |
Last updated on