Skip to content
Image component for Ink
Branch: master
Clone or download
Latest commit 0652db9 Mar 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.npmrc
.travis.yml
fixture.png
index.js
license
package.json
readme.md
screenshot.png
test.js

readme.md

ink-image Build Status

Image component for Ink

Currently only supported on iTerm >=3.

Install

$ npm install ink-image

Usage

import React from 'react';
import {render} from 'ink';
import Image from 'ink-image';

render(
	<Image preserveAspectRatio src='unicorn.jpg' width='50%'/>
);

API

<Image/>

Besides the props below, it accepts props allowed in ansi-escapes.

src

Type: string | Buffer

Path to an image or the image as a Buffer.

alt

Type: string

Alternative text to show when an image can't be displayed.

License

MIT © Kevin Mårtensson

You can’t perform that action at this time.