VaneUI

VaneUI

Basic Components

Img

Displays images with VaneUI styling support including sizes, shapes, borders, shadows, and object-fit options.

Basic Image

Render an image with the Img component.

Placeholder image
react-icon

BasicImage.tsx

<Img
alt="Placeholder image"
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
/>

Image Shapes

Control border radius with rounded (default), pill, and sharp.

pill image

pill

sharp image

sharp

rounded image

rounded

react-icon

ImageShapes.tsx

<Row flexWrap>
<Col itemsCenter>
<Img
alt="pill image"
pill
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
/>
<Text secondary sm>pill</Text>
</Col>
<Col itemsCenter>
<Img
alt="sharp image"
sharp
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
/>
<Text secondary sm>sharp</Text>
</Col>
<Col itemsCenter>
<Img
alt="rounded image"
rounded
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
/>
<Text secondary sm>rounded</Text>
</Col>
</Row>

Image with Border & Shadow

Add border and shadow props for visual emphasis.

Bordered image

border

Shadow image

shadow

Border and shadow image

border + shadow

react-icon

ImagewithBorder&Shadow.tsx

<Row flexWrap>
<Col itemsCenter>
<Img
alt="Bordered image"
border
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
/>
<Text secondary sm>border</Text>
</Col>
<Col itemsCenter>
<Img
alt="Shadow image"
shadow
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
/>
<Text secondary sm>shadow</Text>
</Col>
<Col itemsCenter>
<Img
alt="Border and shadow image"
border
shadow
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
/>
<Text secondary sm>border + shadow</Text>
</Col>
</Row>

Image Sizes

Images support five sizes: xs, sm, md, lg, xl.

Extra Small image

Extra Small

Small image

Small

Medium image

Medium

Large image

Large

Extra Large image

Extra Large

react-icon

ImageSizes.tsx

<Row flexWrap itemsEnd>
<Col itemsCenter>
<Img
alt="Extra Small image"
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
xs
/>
<Text secondary sm>Extra Small</Text>
</Col>
<Col itemsCenter>
<Img
alt="Small image"
sm
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
/>
<Text secondary sm>Small</Text>
</Col>
<Col itemsCenter>
<Img
alt="Medium image"
md
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
/>
<Text secondary sm>Medium</Text>
</Col>
<Col itemsCenter>
<Img
alt="Large image"
lg
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
/>
<Text secondary sm>Large</Text>
</Col>
<Col itemsCenter>
<Img
alt="Extra Large image"
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
xl
/>
<Text secondary sm>Extra Large</Text>
</Col>
</Row>

Object Fit

Control how the image fills its container with objectCover, objectContain, and objectFill.

Cover

objectCover

Contain

objectContain

Fill

objectFill

react-icon

ObjectFit.tsx

<Row flexWrap>
<Col itemsCenter>
<Img
alt="Cover"
objectCover
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
style={{
height: 150,
width: 200
}}
/>
<Text secondary sm>objectCover</Text>
</Col>
<Col itemsCenter>
<Img
alt="Contain"
objectContain
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
style={{
height: 150,
width: 200
}}
/>
<Text secondary sm>objectContain</Text>
</Col>
<Col itemsCenter>
<Img
alt="Fill"
objectFill
src="https://placehold.co/300x200/e2e8f0/64748b?text=Image"
style={{
height: 150,
width: 200
}}
/>
<Text secondary sm>objectFill</Text>
</Col>
</Row>

Img Props

Size

Size props for controlling component dimensions

xs

Extra small size

sm

Small size

md

Medium size (default)

lg

Large size

xl

Extra large size

Hide

Hide props for responsive element visibility

mobileHide

Hide element on mobile devices and below (max-mobile: 48rem)

tabletHide

Hide element on tablet devices and below (max-tablet: 64rem)

desktopHide

Hide element on desktop devices and below (max-desktop: 80rem)

Items

Items props for controlling flex item alignment (align-items)

itemsStart

Align items to start (top/left)

itemsEnd

Align items to end (bottom/right)

itemsCenter

Align items to center

itemsBaseline

Align items to baseline

itemsStretch

Stretch items to fill container

Justify

Justify props for controlling flex content alignment (justify-content)

justifyStart

Pack items toward the start of the main axis

justifyEnd

Pack items toward the end of the main axis

justifyCenter

Center items along the main axis

justifyBetween

Distribute items with space between them

justifyAround

Distribute items with space around them

justifyEvenly

Distribute items with equal space around them

justifyStretch

Stretch items to fill the main axis

justifyBaseline

Align items along their baseline on main axis

Position

Position props for controlling CSS position property

relative

Relative positioning

absolute

Absolute positioning

fixed

Fixed positioning

sticky

Sticky positioning

static

Static positioning

Display

Display props for controlling CSS display property

inline

Inline display - flows with text

block

Block display - takes full width, new line

inlineBlock

Inline-block display - inline but with block properties

flex

Flex display - flexbox container

inlineFlex

Inline-flex display - inline flexbox container

grid

Grid display - CSS grid container

inlineGrid

Inline-grid display - inline grid container

contents

Contents display - element's box is removed, children display as if parent didn't exist

table

Table display - behaves like table element

tableCell

Table-cell display - behaves like td element

hidden

Hidden display - element is not visible

Overflow

Overflow props for controlling content overflow behavior

overflowAuto

Auto overflow - show scrollbars if needed

overflowHidden

Hidden overflow - clip content without scrollbars

overflowClip

Clip overflow - hard clip without scrollbars

overflowVisible

Visible overflow - content extends beyond bounds

overflowScroll

Scroll overflow - always show scrollbars

overflowXAuto

Auto overflow on X-axis only

overflowYAuto

Auto overflow on Y-axis only

overflowXHidden

Hidden overflow on X-axis only

overflowYHidden

Hidden overflow on Y-axis only

overflowXClip

Clip overflow on X-axis only

overflowYClip

Clip overflow on Y-axis only

overflowXVisible

Visible overflow on X-axis only

overflowYVisible

Visible overflow on Y-axis only

overflowXScroll

Scroll overflow on X-axis only

overflowYScroll

Scroll overflow on Y-axis only

Appearance

Appearance props for controlling component colors

primary

Primary color appearance (gray)

brand

Brand color appearance (blue)

accent

Accent color appearance (rose)

secondary

Secondary color appearance (gray)

tertiary

Tertiary color appearance

success

Success color appearance (green)

danger

Danger color appearance (red)

warning

Warning color appearance (amber)

info

Info color appearance (cyan)

link

Link color appearance (blue, for hyperlinks)

inherit

Inherit appearance from parent — suppresses own data-appearance/data-variant, uses parent's CSS variables

Border

Border props for controlling component borders

border

Enable border on all sides

borderT

Enable border on top

borderB

Enable border on bottom

borderL

Enable border on left

borderR

Enable border on right

borderX

Enable border on left and right

borderY

Enable border on top and bottom

noBorder

Disable all borders

Shadow

Shadow props for controlling drop shadows

shadow

Enable drop shadow

noShadow

Disable drop shadow

Ring

Ring props for controlling focus rings

ring

Enable focus ring

noRing

Disable focus ring

Focus Visible

Focus visible props for controlling focus-visible outlines

focusVisible

Enable focus-visible outline

noFocusVisible

Disable focus-visible outline

Shape

Shape props for controlling component border radius

pill

Fully rounded corners (circular)

sharp

No rounded corners (square)

rounded

Medium rounded corners (default)

Variant

Variant props for controlling component style variations

filled

Filled variant - solid background with contrasting text color

outline

Outline variant - transparent background with border and colored text (default)

Object Fit

Object fit props for controlling image/video sizing within container

objectCover

Cover - image covers container, may be cropped

objectContain

Contain - image fits inside container, may have letterboxing

objectFill

Fill - image stretches to fill container

objectNone

None - image displays at natural size

objectScaleDown

Scale down - like contain, but never scales up

Width

Width props for controlling component width

wFull

Set width to 100%

wFit

Set width to fit-content

wAuto

Set width to auto

wScreen

Set width to 100vw (viewport width), removes max-width constraint

Height

Height props for controlling component height

hFit

Set height to fit-content

hFull

Set height to 100%

hAuto

Set height to auto

hScreen

Set height to 100vh (viewport height), removes max-height constraint

Transparent

Transparent prop for disabling background color

transparent

Disable background color - makes component background transparent

Responsive

Responsive prop for enabling breakpoint-specific sizing

responsive

Enable responsive sizing - uses breakpoint-specific classes for font size, padding, and gap