0.20.1 • Published 3 years ago

@anchor-protocol/token-icons v0.20.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

Anchor Icon Library

These icons are compatible with material-ui's icon.

import { IconButton } from '@material-ui/core';
import { TokenIcon } from '@anchor-protocol/icons';

function App() {
  return <TokenIcon token="ust" />;
}

Storybook

https://anchor-storybook.vercel.app/?path=/story/assets-token-icons--token-icons

API

index.tsx

export function TokenIconBase({
  token,
  variant = 'svg',
  ...imgProps
}: IconProps) {}

export const tokens = ['ust', 'krt', 'aust', 'akrt', 'luna', 'bluna'] as const;

export const variants = ['svg', '@2x', '@3x', '@4x'] as const;

export type Tokens = typeof tokens[number];

export type IconVariant = typeof variants[number];

export interface IconProps
  extends Omit<
    DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>,
    'src'
  > {
  token: Tokens;
  variant?: IconVariant;
}

export const TokenIcon = styled(TokenIconBase)`
  width: 1em;
  height: 1em;
`;

export const GifIcon = styled.img`
  width: 1em;
  height: 1em;
`;
0.20.1

3 years ago

0.20.0

3 years ago

0.19.0

3 years ago

0.18.0

3 years ago

0.17.0

3 years ago

0.17.1

3 years ago

0.16.0

3 years ago

0.16.0-alpha.4

3 years ago

0.16.0-alpha.1

3 years ago

0.16.0-alpha.3

3 years ago

0.16.0-alpha.2

3 years ago

0.15.0

3 years ago

0.10.0

3 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago