Component field guide

Explore live variants, compare states, and learn every prop. Pick a component to start.

LIVE COMPONENT

WelkSticker

An image with an SVG outline following its alpha silhouette and a sticking animation after load. Transparent artwork produces a cutout; opaque backgrounds are outlined as part of the image. Optional hover elevation adds depth, and load failures can use fallbackSrc.

Superman sticker

Usage

React / TSX
import { WelkSticker } from "@welkui/react";
import superman from "./superman.png";

<WelkSticker src={superman} alt="Superman sticker"
  width={140} height={160} elevateOnHover />

Import @welkui/react/styles.css once in your app. Stateful snippets belong inside a React component.

Variants and behavior

  • One sticker presentation; configurable outline color/thickness and hover elevation.

Visual variant gallery

These are real components, not screenshots. Compare their appearance and try the controls. Key props below each preview show what changes; use the usage example above for imports and component setup.

Default outline

Transparent artwork reveals the silhouette. Reloading the image plays the sticking animation.

Default Superman cutout
Key propsoutlineThickness={6} outlineColor="white"

Colored thick outline

Use a stronger outline to make artwork stand out on its surface.

Yellow outlined Superman cutout
Key propsoutlineThickness={10} outlineColor="#ffdf52"

Hover elevation

Move over the sticker to lift it. Reduced-motion preferences are respected.

Hoverable Superman cutout
Key propselevateOnHover

No outline

Zero thickness leaves just the artwork and its sticker presentation.

Unoutlined Superman cutout
Key propsoutlineThickness={0}

Fallback artwork

An intentionally invalid source demonstrates recovery with local fallback artwork.

Recovered Superman cutout
Key propssrc={brokenImage} fallbackSrc={superman}

Usage notes and accessibility

  • Use transparent PNG/WebP artwork for a silhouette cutout. The outline follows the alpha channel, so an opaque rectangular background remains a rectangle.
  • outlineThickness is a finite non-negative pixel value. outlineColor sets the edge; elevateOnHover is optional decoration rather than an action.
  • The sticking animation starts after load and honors reduced motion. Supply fallbackSrc when recovery is useful and descriptive alt text unless the artwork is decorative.

Props

Required props are marked in the default column. Other props are optional. ReactNode accepts text or JSX.

WelkSticker prop reference
PropTypeDefaultDescription
srcstringRequiredImage URL or imported local asset.
altstringRequiredAccessible image description; use "" for purely decorative artwork.
fallbackSrcstringUnsetAlternative image if loading the original fails.
outlineThicknessnumber6Finite non-negative outline width in pixels.
outlineColorCSSProperties["color"]"white"Silhouette outline color.
elevateOnHoverbooleanfalseEnables lifted hover styling.

Native props and refs

Inherits native image props except src, alt and children, including width, height, loading, onLoad, onError, className and style; forwards an image ref.

Project setup, styling and Next.js

Import @welkui/react/styles.css once in your app entry or Next.js root layout. The previews use the default theme; override --welk-* CSS tokens in your app to customize it.

For Next.js, put hooks and event handlers in a component beginning with "use client". Keep state local to the component using the control. The library preserves its client boundaries and uses your installed React version.

Use defaultValue or defaultChecked for uncontrolled fields, or a state value and its change callback for controlled fields. Do not switch between these modes during the lifetime of a field.

Modal and notification examples start closed: use their Try buttons to see them. Disabled examples are deliberately non-interactive. Validate forms, uploads, authentication, and server responses in your application; these components only provide UI.