Thumbnails are used as visual anchors and identifiers for objects.
yarn add @weave-design/thumbnail @weave-design/theme-context @weave-design/theme-data
import Thumbnail from '@weave-design/thumbnail';
<Thumbnail alt="Weave Logo" src="https://d95xa459ljwvg.cloudfront.net/theme/weave-logo.svg" />
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} />
);
}