1.0.0 • Published 1 year ago

@weave-design/thumbnail v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

Thumbnail

Thumbnails are used as visual anchors and identifiers for objects.

Getting started

yarn add @weave-design/thumbnail @weave-design/theme-context @weave-design/theme-data

Import the component

import Thumbnail from '@weave-design/thumbnail';

Basic usage

<Thumbnail alt="Weave Logo" src="https://d95xa459ljwvg.cloudfront.net/theme/weave-logo.svg" />

Styling

Use the className prop to pass in a css class name to the outermost container of the component. The class name will also pass down to most of the other styled elements within the component.

Spacer also has a stylesheet prop that accepts a function wherein you can modify its styles. For instance

import Thumbnail from '@weave-design/thumbnail';

function YourComponent() {
  // ...
  const customStylesheet = (styles, props, themeData) => ({
    ...styles,
    thumbnail: {
      ...styles.thumbnail,
      wrapper: {
        ...styles.thumbnail.wrapper,
        color: themeData["colorScheme.status.error"],
      },
      border: {
        ...styles.thumbnail.border,
        color: themeData["colorScheme.status.error"],
      },
      image: {
        ...styles.thumbnail.image,
        color: themeData["colorScheme.status.error"],
      },
    },
  });

  return (
    <Thumbnail stylesheet={customStylesheet} />
  );
}